Python Forum
Hi everyone - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Hi everyone (/thread-25302.html)



Hi everyone - astral_travel - Mar-26-2020

i have this code, and for some reason the compiler sees the input() of (what's your age) as string, instead of integer.

what to do ?

i appreciate your help !

Tal

print('Hi mate, what is your name ?')

Name = input()

print('Hello ' + Name + ' its nice to meet you')

print('what is your age ?')

Age = input(int)

if ((Age >= 60) and (Age < 70)):

	print('I see you are in your 60s, thats a very good age to be, lots of wisdom')

else:
	print('your age is not within the paramaters')



RE: Hi everyone - ndc85430 - Mar-26-2020

Why are you passing the function int to input? You should be taking the return value of input and passing it to int. Also, note that input takes a string that is used as a prompt (so using print for the prompt is unnecessary), e.g.

age = int(input("How old are you?"))


RE: Hi everyone - astral_travel - Mar-26-2020

thank you so much !