I'm quite new to Python, and am trying to make a simple unit converter - was hoping if anyone could tell me where i'm going wrong? This is the script as it stands: input('Would you like to convert centimeters to inches (a), or inches to centimeters (b)?\ntype a or b: ') if type('a'): dist_cent=float(input('measurement in centimeters: ')) print(dist_cent /2.54) elif type('b'): dist_inch=float(input('measurement in inches: ')) print(dist_inch *2.54) If the user inputs 'a', the first 'if' works as it should. But if the user inputs 'b', instead of running the 'elif' statement, it runs the first 'if' statement as if the …

Member Avatar
Member Avatar
+0 forum 2

I'm quite new to programming and i'm trying to write a formula to work out the capacitance of capacitors - and is what I have below. I then want to convert the value I have (in pico farrads) into micro farrads. Here's what I have so far: while True: x=float(input("First number: ")) y=float(input("Second number: ")) z=float(input("Third number: ")) x=int(x) y=int(y) z=int(z) print(int(str(x)+str(y))*10**z) replay=input("Would you like to calculate again? (yes/no) ") print('\n') if replay=="no": print("...Terminated Program.") break print('\n') I want to assign the variable 'pf' to the result of line 11, so that I can then multiply the result by *10**-3. …

Member Avatar
Member Avatar
+0 forum 3

I'm quite new to python and am trying to make a kind of 20Q thing, but am struggling - anybody know how to delete a list from a set, or if not a list from a list? Thanks :)

Member Avatar
Member Avatar
+0 forum 5

The End.