Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hi everyone
#1
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')
Reply
#2
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?"))
Reply
#3
thank you so much !
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020