Computer Science, asked by c7352152, 11 months ago

Fix this Python code:
myname = input("please enter your name")

myage = int(input(please enter your age"))

print("your name is ", myname, "your age is", myage)

If(myage >18):

print("Your ages tells people that you are an adult", myage)

else:

print("Your ages tells people that you are a child", myage)



print("The program has finished")

Answers

Answered by Anonymous
0

myname = input("please enter your name")

myage = int(input(please enter your age"))

correction:- myage = int(input("please enter your age"))

print("your name is ", myname, "your age is", myage)

If(myage >18):

print("Your ages tells people that you are an adult", myage)

correction:- print("Your ages tells people that you are an adult", myname)

else:

print("Your ages tells people that you are a child", myage)

correction:-

print("Your ages tells people that you are a child", myname)

print("The program has finished")

Answered by eburcham58
0

Answer:

myname = input("please enter your name")

myage = int(input("please enter your age"))

print("your name is ", myname, "your age is", myage)

if (myage >18):

   print("Your ages tells people that you are an adult", myage)

else:

   print("Your ages tells people that you are a child", myage)

print("The program has finished")

Explanation:

you spelled if as If with capitals letters and it will not accept that, and for the myage input you forgot to put (") so it shoud have looked like this ("please enter your age")) you forgot to indent the print after the if(myage >18): statment

Similar questions