Python Homework Help

MCG

Active Member
Reputation
0
Can any of you help me with this?

Homework:

Ask the user to input his age
Store his age as <age>
Ask the user to input his name
Store his name as <name>
Display on the screen “Hello <name>, I am pleased to meet you, <age> is a nice age to be”.

I'm confused as before the program I did in class was:

print('How many cm do you wish to convert into inches?')
cm=float(input())
inches=0.394*cm
print('This is',inches,'inches')

I thought it would be fairly similar but I keep getting invalid syntax as it's not recognizing 'name'

What I have here:

print('Please input your age')
age=float(input())
print('Please input your name')
name=float(input())
print('Hello 'name', I am pleased to meet you, 'age' is a nice age to be')

Thanks if you can help :)
 
What version of python are you using?
 
Oh ok dude i can hep when ever you need it again if you want
 
Back
Top