What is wrong with this code? This supposed to be a python code.

def main():
print("This is meant for me to learn about different types of people.")
print("What is your favorite animal")
favAnimal = input("What is your favorite animal?")

print("Wow that's a really cool animal.")
print("Do you know how to speak different languages")
answer = input("Do you know how to speak different languages")
if(answer == "yes"):
print("That's amazing")

else:

print("You don't know how to speak different languages don't sweat it neither do I.")
main()

Respuesta :

def main():

   print("This is meant for me to learn about different types of people.")

   #print("What is your favorite animal")

   favAnimal = input("What is your favorite animal?")

   #print("Wow that's a really cool animal.")

   #print("Do you know how to speak different languages")

   answer = input("Do you know how to speak different languages")

   if(answer == "yes"):

       print("That's amazing")

   else:

       print("You don't know how to speak different languages don't sweat it neither do I.")

main()

1. We have to comment/remove all those lines with the print () method that contain questions and "must" accept user input, because in the variable declaration the questions with the input are already printed.

2. Since there are no curly braces in Python, you should use tabs instead.

ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE