I am working my way through projects on rosettacode to learn Python programming. I have tried to research the answer to my question, but I am guessing I don't know enough to Google the answer just right.
The challenge was: In this task, the goal is to input a string and the integer 75000, from the text console.
My code:
Person = input('Enter your name, please:')
print('Hello', Person)
input('Enter 75000: ')
print('Thank you')
The answer in the wiki said in part:
The preferred way of getting numbers from the user is to take the input as a string, and pass it to any one of the numeric types to create an instance of the appropriate number.
number = float(raw_input("Input a number: "))
Python 3.0 equivalent:
number = float(input("Input a number: "))
float may be replaced by any numeric type, such as int, complex, or decimal.Decimal. Each one varies in expected input.
Though my code still worked, I want to understand this way.