March 1st, 2013, 10:40 PM
Python Settings Help please!
Hi, so I am trying to learn Python through a book. And i ran into an issue that i dont know how to solve.
so the code is celsius = input("___") , when i press enter, the next line asks me what the input is. How do i configure python so that the program will only ask me that when i want to run it? because right now each line is running automatically after every line. Help is much appreciated!
March 1st, 2013, 11:12 PM
Please try to write more clearly. You sound like me.
"each line runs after every line".
I think I get the drift. Define a function. The function code won't execute until you ask.
>>> def c2k():
... c = input('___')
... return float(c)+273.28 # or whatever the constant is
>>> c2k() # now evaluate the function
[/code] are essential for python code and Makefiles!
March 2nd, 2013, 10:31 AM
c = input("Enter celcius: ")
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25