龙空技术网

python计算并联电阻的阻值

理思录 79

前言:

此刻同学们对“python357怎么修”大致比较关怀,姐妹们都想要剖析一些“python357怎么修”的相关资讯。那么小编也在网络上网罗了一些对于“python357怎么修””的相关知识,希望同学们能喜欢,你们快快来学习一下吧!

通过输入目标电阻,寻找两个标准电阻,实现该阻值的精确化。

list=[10	,11	,12	,13	,15	,16	,18	,20	,22	,24	,27	,30	,33	,36	,39	,43	,47	,51	,56	,62	,68	,75	,82	,82	,91	,100	,101	,102	,104	,105	,106	,107	,109	,110	,111	,113	,114	,115	,117	,118	,120	,121	,123	,124	,126	,127	,127	,129	,130	,132	,133	,135	,137	,138	,140	,142	,143	,145	,147	,147	,149	,150	,152	,154	,156	,158	,160	,162	,164	,165	,167	,169	,174	,176	,178	,180	,182	,184	,187	,189	,191	,193	,196	,198	,200	,203	,205	,208	,210	,213	,215	,218	,221	,223	,226	,229	,232	,232	,234	,237	,240	,243	,246	,249	,252	,255	,258	,261	,264	,267	,267	,271	,274	,277	,280	,284	,287	,291	,294	,298	,301	,305	,309	,312	,316	,320	,324	,328	,332	,336	,340	,344	,348	,352	,357	,361	,365	,370	,374	,379	,388	,392	,397	,402	,407	,412	,417	,422	,427	,432	,437	,442	,448	,453	,459	,464	,470	,475	,481	,487	,493	,499	,505	,511	,517	,523	,530	,536	,542	,549	,556	,562	,569	,576	,583	,590	,597	,604	,612	,619	,626	,634	,642	,649	,657	,665	,673	,681	,690	,698	,706	,715	,723	,732	,741	,750	,759	,768	,777	,787	,796	,806	,806	,816	,825	,835	,845	,856	,866	,876	,887	,898	,909	,920	,931	,942	,953	,965	,976	,988	,1	,1.1	,1.2	,1.3	,1.5	,1.6	,1.8	,2	,2.2	,2.4	,2.7	,3	,3.3	,3.6	,3.9	,4.3	,4.7	,5.1	,5.6	,6.2	,6.8	,7.5	,8.2	,8.2	,9.1	,10	,10.1	,10.2	,10.4	,10.5	,10.6	,10.7	,10.9	,11	,11.1	,11.3	,11.4	,11.5	,11.7	,11.8	,12	,12.1	,12.3	,12.4	,12.6	,12.7	,12.7	,12.9	,13	,13.2	,13.3	,13.5	,13.7	,13.8	,14	,14.2	,14.3	,14.5	,14.7	,14.7	,14.9	,15	,15.2	,15.4	,15.6	,15.8	,16	,16.2	,16.4	,16.5	,16.7	,16.9	,17.4	,17.6	,17.8	,18	,18.2	,18.4	,18.7	,18.9	,19.1	,19.3	,19.6	,19.8	,20	,20.3	,20.5	,20.8	,21	,21.3	,21.5	,21.8	,22.1	,22.3	,22.6	,22.9	,23.2	,23.2	,23.4	,23.7	,24	,24.3	,24.6	,24.9	,25.2	,25.5	,25.8	,26.1	,26.4	,26.7	,26.7	,27.1	,27.4	,27.7	,28	,28.4	,28.7	,29.1	,29.4	,29.8	,30.1	,30.5	,30.9	,31.2	,31.6	,32	,32.4	,32.8	,33.2	,33.6	,34	,34.4	,34.8	,35.2	,35.7	,36.1	,36.5	,37	,37.4	,37.9	,38.8	,39.2	,39.7	,40.2	,40.7	,41.2	,41.7	,42.2	,42.7	,43.2	,43.7	,44.2	,44.8	,45.3	,45.9	,46.4	,47	,47.5	,48.1	,48.7	,49.3	,49.9	,50.5	,51.1	,51.7	,52.3	,53	,53.6	,54.2	,54.9	,55.6	,56.2	,56.9	,57.6	,58.3	,59	,59.7	,60.4	,61.2	,61.9	,62.6	,63.4	,64.2	,64.9	,65.7	,66.5	,67.3	,68.1	,69	,69.8	,70.6	,71.5	,72.3	,73.2	,74.1	,75	,75.9	,76.8	,77.7	,78.7	,79.6	,80.6	,80.6	,81.6	,82.5	,83.5	,84.5	,85.6	,86.6	,87.6	,88.7	,89.8	,90.9	,92	,93.1	,94.2	,95.3	,96.5	,97.6	,98.8	,0.1	,0.11	,0.12	,0.13	,0.15	,0.16	,0.18	,0.2	,0.22	,0.24	,0.27	,0.3	,0.33	,0.36	,0.39	,0.43	,0.47	,0.51	,0.56	,0.62	,0.68	,0.75	,0.82	,0.82	,0.91	,1	,1.01	,1.02	,1.04	,1.05	,1.06	,1.07	,1.09	,1.1	,1.11	,1.13	,1.14	,1.15	,1.17	,1.18	,1.2	,1.21	,1.23	,1.24	,1.26	,1.27	,1.27	,1.29	,1.3	,1.32	,1.33	,1.35	,1.37	,1.38	,1.4	,1.42	,1.43	,1.45	,1.47	,1.47	,1.49	,1.5	,1.52	,1.54	,1.56	,1.58	,1.6	,1.62	,1.64	,1.65	,1.67	,1.69	,1.74	,1.76	,1.78	,1.8	,1.82	,1.84	,1.87	,1.89	,1.91	,1.93	,1.96	,1.98	,2	,2.03	,2.05	,2.08	,2.1	,2.13	,2.15	,2.18	,2.21	,2.23	,2.26	,2.29	,2.32	,2.32	,2.34	,2.37	,2.4	,2.43	,2.46	,2.49	,2.52	,2.55	,2.58	,2.61	,2.64	,2.67	,2.67	,2.71	,2.74	,2.77	,2.8	,2.84	,2.87	,2.91	,2.94	,2.98	,3.01	,3.05	,3.09	,3.12	,3.16	,3.2	,3.24	,3.28	,3.32	,3.36	,3.4	,3.44	,3.48	,3.52	,3.57	,3.61	,3.65	,3.7	,3.74	,3.79	,3.88	,3.92	,3.97	,4.02	,4.07	,4.12	,4.17	,4.22	,4.27	,4.32	,4.37	,4.42	,4.48	,4.53	,4.59	,4.64	,4.7	,4.75	,4.81	,4.87	,4.93	,4.99	,5.05	,5.11	,5.17	,5.23	,5.3	,5.36	,5.42	,5.49	,5.56	,5.62	,5.69	,5.76	,5.83	,5.9	,5.97	,6.04	,6.12	,6.19	,6.26	,6.34	,6.42	,6.49	,6.57	,6.65	,6.73	,6.81	,6.9	,6.98	,7.06	,7.15	,7.23	,7.32	,7.41	,7.5	,7.59	,7.68	,7.77	,7.87	,7.96	,8.06	,8.06	,8.16	,8.25	,8.35	,8.45	,8.56	,8.66	,8.76	,8.87	,8.98	,9.09	,9.2	,9.31	,9.42	,9.53	,9.65	,9.76	,9.88	,100	,110	,120	,130	,150	,160	,180	,200	,220	,240	,270	,300	,330	,360	,390	,430	,470	,510	,560	,620	,680	,750	,820	,820	,910	,1000	,1010	,1020	,1040	,1050	,1060	,1070	,1090	,1100	,1110	,1130	,1140	,1150	,1170	,1180	,1200	,1210	,1230	,1240	,1260	,1270	,1270	,1290	,1300	,1320	,1330	,1350	,1370	,1380	,1400	,1420	,1430	,1450	,1470	,1470	,1490	,1500	,1520	,1540	,1560	,1580	,1600	,1620	,1640	,1650	,1670	,1690	,1740	,1760	,1780	,1800	,1820	,1840	,1870	,1890	,1910	,1930	,1960	,1980	,2000	,2030	,2050	,2080	,2100	,2130	,2150	,2180	,2210	,2230	,2260	,2290	,2320	,2320	,2340	,2370	,2400	,2430	,2460	,2490	,2520	,2550	,2580	,2610	,2640	,2670	,2670	,2710	,2740	,2770	,2800	,2840	,2870	,2910	,2940	,2980	,3010	,3050	,3090	,3120	,3160	,3200	,3240	,3280	,3320	,3360	,3400	,3440	,3480	,3520	,3570	,3610	,3650	,3700	,3740	,3790	,3880	,3920	,3970	,4020	,4070	,4120	,4170	,4220	,4270	,4320	,4370	,4420	,4480	,4530	,4590	,4640	,4700	,4750	,4810	,4870	,4930	,4990	,5050	,5110	,5170	,5230	,5300	,5360	,5420	,5490	,5560	,5620	,5690	,5760	,5830	,5900	,5970	,6040	,6120	,6190	,6260	,6340	,6420	,6490	,6570	,6650	,6730	,6810	,6900	,6980	,7060	,7150	,7230	,7320	,7410	,7500	,7590	,7680	,7770	,7870	,7960	,8060	,8060	,8160	,8250	,8350	,8450	,8560	,8660	,8760	,8870	,8980	,9090	,9200	,9310	,9420	,9530	,9650	,9760	,9880	,1000	,1100	,1200	,1300	,1500	,1600	,1800	,2000	,2200	,2400	,2700	,3000	,3300	,3600	,3900	,4300	,4700	,5100	,5600	,6200	,6800	,7500	,8200	,8200	,9100	,10000	,10100	,10200	,10400	,10500	,10600	,10700	,10900	,11000	,11100	,11300	,11400	,11500	,11700	,11800	,12000	,12100	,12300	,12400	,12600	,12700	,12700	,12900	,13000	,13200	,13300	,13500	,13700	,13800	,14000	,14200	,14300	,14500	,14700	,14700	,14900	,15000	,15200	,15400	,15600	,15800	,16000	,16200	,16400	,16500	,16700	,16900	,17400	,17600	,17800	,18000	,18200	,18400	,18700	,18900	,19100	,19300	,19600	,19800	,20000	,20300	,20500	,20800	,21000	,21300	,21500	,21800	,22100	,22300	,22600	,22900	,23200	,23200	,23400	,23700	,24000	,24300	,24600	,24900	,25200	,25500	,25800	,26100	,26400	,26700	,26700	,27100	,27400	,27700	,28000	,28400	,28700	,29100	,29400	,29800	,30100	,30500	,30900	,31200	,31600	,32000	,32400	,32800	,33200	,33600	,34000	,34400	,34800	,35200	,35700	,36100	,36500	,37000	,37400	,37900	,38800	,39200	,39700	,40200	,40700	,41200	,41700	,42200	,42700	,43200	,43700	,44200	,44800	,45300	,45900	,46400	,47000	,47500	,48100	,48700	,49300	,49900	,50500	,51100	,51700	,52300	,53000	,53600	,54200	,54900	,55600	,56200	,56900	,57600	,58300	,59000	,59700	,60400	,61200	,61900	,62600	,63400	,64200	,64900	,65700	,66500	,67300	,68100	,69000	,69800	,70600	,71500	,72300	,73200	,74100	,75000	,75900	,76800	,77700	,78700	,79600	,80600	,80600	,81600	,82500	,83500	,84500	,85600	,86600	,87600	,88700	,89800	,90900	,92000	,93100	,94200	,95300	,96500	,97600	,98800	,10000	,11000	,12000	,13000	,15000	,16000	,18000	,20000	,22000	,24000	,27000	,30000	,33000	,36000	,39000	,43000	,47000	,51000	,56000	,62000	,68000	,75000	,82000	,82000	,91000	,100000	,101000	,102000	,104000	,105000	,106000	,107000	,109000	,110000	,111000	,113000	,114000	,115000	,117000	,118000	,120000	,121000	,123000	,124000	,126000	,127000	,127000	,129000	,130000	,132000	,133000	,135000	,137000	,138000	,140000	,142000	,143000	,145000	,147000	,147000	,149000	,150000	,152000	,154000	,156000	,158000	,160000	,162000	,164000	,165000	,167000	,169000	,174000	,176000	,178000	,180000	,182000	,184000	,187000	,189000	,191000	,193000	,196000	,198000	,200000	,203000	,205000	,208000	,210000	,213000	,215000	,218000	,221000	,223000	,226000	,229000	,232000	,232000	,234000	,237000	,240000	,243000	,246000	,249000	,252000	,255000	,258000	,261000	,264000	,267000	,267000	,271000	,274000	,277000	,280000	,284000	,287000	,291000	,294000	,298000	,301000	,305000	,309000	,312000	,316000	,320000	,324000	,328000	,332000	,336000	,340000	,344000	,348000	,352000	,357000	,361000	,365000	,370000	,374000	,379000	,388000	,392000	,397000	,402000	,407000	,412000	,417000	,422000	,427000	,432000	,437000	,442000	,448000	,453000	,459000	,464000	,470000	,475000	,481000	,487000	,493000	,499000	,505000	,511000	,517000	,523000	,530000	,536000	,542000	,549000	,556000	,562000	,569000	,576000	,583000	,590000	,597000	,604000	,612000	,619000	,626000	,634000	,642000	,649000	,657000	,665000	,673000	,681000	,690000	,698000	,706000	,715000	,723000	,732000	,741000	,750000	,759000	,768000	,777000	,787000	,796000	,806000	,806000	,816000	,825000	,835000	,845000	,856000	,866000	,876000	,887000	,898000	,909000	,920000	,931000	,942000	,953000	,965000	,976000	,988000	,100000	,110000	,120000	,130000	,150000	,160000	,180000	,200000	,220000	,240000	,270000	,300000	,330000	,360000	,390000	,430000	,470000	,510000	,560000	,620000	,680000	,750000	,820000	,820000	,910000	,1000000	,1010000	,1020000	,1040000	,1050000	,1060000	,1070000	,1090000	,1100000	,1110000	,1130000	,1140000	,1150000	,1170000	,1180000	,1200000	,1210000	,1230000	,1240000	,1260000	,1270000	,1270000	,1290000	,1300000	,1320000	,1330000	,1350000	,1370000	,1380000	,1400000	,1420000	,1430000	,1450000	,1470000	,1470000	,1490000	,1500000	,1520000	,1540000	,1560000	,1580000	,1600000	,1620000	,1640000	,1650000	,1670000	,1690000	,1740000	,1760000	,1780000	,1800000	,1820000	,1840000	,1870000	,1890000	,1910000	,1930000	,1960000	,1980000	,2000000	,2030000	,2050000	,2080000	,2100000	,2130000	,2150000	,2180000	,2210000	,2230000	,2260000	,2290000	,2320000	,2320000	,2340000	,2370000	,2400000	,2430000	,2460000	,2490000	,2520000	,2550000	,2580000	,2610000	,2640000	,2670000	,2670000	,2710000	,2740000	,2770000	,2800000	,2840000	,2870000	,2910000	,2940000	,2980000	,3010000	,3050000	,3090000	,3120000	,3160000	,3200000	,3240000	,3280000	,3320000	,3360000	,3400000	,3440000	,3480000	,3520000	,3570000	,3610000	,3650000	,3700000	,3740000	,3790000	,3880000	,3920000	,3970000	,4020000	,4070000	,4120000	,4170000	,4220000	,4270000	,4320000	,4370000	,4420000	,4480000	,4530000	,4590000	,4640000	,4700000	,4750000	,4810000	,4870000	,4930000	,4990000	,5050000	,5110000	,5170000	,5230000	,5300000	,5360000	,5420000	,5490000	,5560000	,5620000	,5690000	,5760000	,5830000	,5900000	,5970000	,6040000	,6120000	,6190000	,6260000	,6340000	,6420000	,6490000	,6570000	,6650000	,6730000	,6810000	,6900000	,6980000	,7060000	,7150000	,7230000	,7320000	,7410000	,7500000	,7590000	,7680000	,7770000	,7870000	,7960000	,8060000	,8060000	,8160000	,8250000	,8350000	,8450000	,8560000	,8660000	,8760000	,8870000	,8980000	,9090000	,9200000	,9310000	,9420000	,9530000	,9650000	,9760000	,9880000	,]target=50cha=0.00001flag=1def cal01(r1,r2):    return (r1*r2)/(r1+r2)def cal02(r1,r2):    return (r1+r2)    for a in list:    for b in list:        i=a        j=b        test=cal01(i,j)        i1=i*(1+cha)        j1=j*(1+cha)        test1=cal01(i1,j1)        i1=i*(1+cha)        j1=j*(1-cha)        test2=cal01(i1,j1)        i1=i*(1-cha)        j1=j*(1+cha)        test3=cal01(i1,j1)        i1=i*(1-cha)        j1=j*(1-cha)        test4=cal01(i1,j1)        #print(i,j,"=",test)        if test>=target:            wucha0=test-target        else:            wucha0=target-test        if test1>=target:            wucha1=test1-target        else:            wucha1=target-test1        if test2>=target:            wucha2=test2-target        else:            wucha2=target-test2        if test3>=target:            wucha3=test3-target        else:            wucha3=target-test3        if test4>=target:            wucha4=test4-target        else:            wucha4=target-test4        wucha=wucha0+wucha1+wucha2+wucha3+wucha4        if flag==1:            miniwucha=wucha            flag=0        if wucha<=miniwucha:            miniwucha=wucha            ni=i            nj=jprint(ni,nj,cal01(ni,nj))i1=i*(1+cha)j1=j*(1+cha)test1=cal01(i1,j1)i1=i*(1+cha)j1=j*(1-cha)test2=cal01(i1,j1)i1=i*(1-cha)j1=j*(1+cha)test3=cal01(i1,j1)i1=i*(1-cha)j1=j*(1-cha)test4=cal01(i1,j1)ni1=ni*(1+cha)nj1=nj*(1+cha)test1=cal01(ni1,nj1)#print(ni1,nj1,(ni1*nj1)/(ni1+nj1))print(cal01(ni1,nj1))ni1=ni*(1-cha)nj1=nj*(1+cha)#print(ni1,nj1,(ni1*nj1)/(ni1+nj1))print(cal01(ni1,nj1))ni1=ni*(1-cha)nj1=nj*(1-cha)#print(ni1,nj1,(ni1*nj1)/(ni1+nj1))print(cal01(ni1,nj1))        ni1=ni*(1+cha)nj1=nj*(1-cha)#print(ni1,nj1,(ni1*nj1)/(ni1+nj1))print(cal01(ni1,nj1))        print(target*(1-cha),target*(1+cha))print("target=",target)

标签: #python357怎么修