Oct-29-2017, 10:37 PM
This may seem like a stupid question.. But, I just started learning python today. And here is my dilemma, when coming across input I was confused as to why input would be used here and not str for example
name = input("What is your name: ")
age = int(input("How old are you: "))
year = str((2014 - age)+100)
print(name + " will be 100 years old in the year " + year)
Why wouldn't you use, name = str("What is your name: ")
Or could you use either and it is based off your preference, any clarification would be greatly appreciated
name = input("What is your name: ")
age = int(input("How old are you: "))
year = str((2014 - age)+100)
print(name + " will be 100 years old in the year " + year)
Why wouldn't you use, name = str("What is your name: ")
Or could you use either and it is based off your preference, any clarification would be greatly appreciated