Ask your own question, for FREE!
Computer Science 15 Online
yy:

WHAT IS WRONG WITH THE CODE????? def main(): cost=(input("do you want to go on a diving trip. (yes or no)")) if(answer == "yes"): cost=(input("it is $200 to go will you pay?") print("The cost to go is " + $200 will you pay? + ".") main()

yy:

help plz

ThisGirlPretty:

@ultrilliam :eyes:

yy:

why?

yy:

can you help me deo

yy:

Thow

yy:

help plz

yy:

:blue:

yy:

:(

yy:

help plz

Vocaloid:

this is python, right? if so, I see two issues: in line 5: cost=(input("it is $200 to go will you pay?") you're missing an ending parentheses. you have two sets of opening parentheses, one for the input prompt, and the other for the cost variable, so you need 2 ending parentheses change to ---> cost=(input("it is $200 to go will you pay?")) there's a second issue: in line 2, you have the user input stored to the variable "cost", but you want the yes/no answer to be stored in the variable "answer" because that's how you define it in the if statement. change the cost variable to answer.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!