How to give input from console in Python?
The answer to this frequent question of beginners:
If you want to read an integer -
You will also find this post useful: http://love-python.blogspot.com/2010/11/fast-way-to-get-input-from-stdin-python.html
name = raw_input()
print name
If you want to read an integer -
num = raw_input()
num = int(num) # raw_input returns string, so convert it to integer
You will also find this post useful: http://love-python.blogspot.com/2010/11/fast-way-to-get-input-from-stdin-python.html
Comments