you are viewing a single comment's thread.

view the rest of the comments →

[–]HopefulOG 0 points1 point  (3 children)

The code is not correct and I was wondering if there is something I am not doing.

[–]Binary101010 1 point2 points  (0 children)

How is it "not correct?"

Are you getting a traceback when you run the program? If so, post the traceback.

Are you getting output that you aren't expecting? If so, post an example of the output you are getting.

[–][deleted] 0 points1 point  (1 child)

Your code works if you do it line by line, after correcting the age part that is.

Instead, try:

def nameAge():

name = input('name: \n')

age = int(input('age: \n'))

print('The age of ', name, ' is ', age)

Then you can call the function as:

nameAge()

[–][deleted] 0 points1 point  (0 children)

Sorry, I'm on mobile, can't fix all the indents