Hi i am wondering what i did wrong here- def ask() : answer = raw input("Do you wish to tell me about your favorite desert?") If (answer == 'yes' ) : print ("Next i will ask you about your favorite desert") Print ("now i will tell you about your clasess favorite desert")

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

Hi i am wondering what i did wrong here- def ask() : answer = raw input("Do you wish to tell me about your favorite desert?") If (answer == 'yes' ) : print ("Next i will ask you about your favorite desert") Print ("now i will tell you about your clasess favorite desert")

MIT 6.00 Intro Computer Science (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

you have a few syntax errors, raw input has to be raw_input, you can not capitalize if or print.
you can see syntax errors when you try and run the program, they should highlight in red, and as you fix each error it will point out another.
Thanks for the help

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

i have a syntax error that im not sure how to resolve If (answer == 'yes' ) : print ("Next i will ask you about your favorite desert") The colon is the line is having a syntax problem and im not sure what is wrong, thanks
the i is capitalized in if
yeah it is, but im getting a snytax eorr on the colon
where it points unfortunately is not always 100% accurate, its close but the error may be somewhere else on that line or even another place entirely, python is case sensitive.
so it will not recognize If,Else,Return it will recognize if, else, return
ok i fixed the syntax, now when i go to run the module it will run and nothing happens (im a beginner)
im not sure if i just need to add something to the end of the script,
so now you have a working program. cool but what you have written so far is a function. A function will not do anything unless you have called it somewhere. you can simply call it by typing ask() anywhere after the function has been defined. So you can not call ask() before you have defined the function ask(), later on in this course there are instances where a function will call itself within itself. Dont worry about that yet.
>>> >>> ask () Do you wish to tell me about your favorite desert?yes Next i will ask you about your favorite desert Traceback (most recent call last): File "", line 1, in ask () File "C:\Python25\fixedhw.py", line 4, in ask Print ("now i will tell you about your clasess favorite desert") NameError: global name 'Print' is not defined This is the error im getting when i call the function
its another syntax error, try and find out what it is, and if you still need help let me know
ok i found it, thank you very much youv been a great help, now im wondering about this, i am trying to mkae the program do=that asks the user whether they wish to tell which is their favorite dessert, or they wish to find out what other's favorite dessert is. Now when i do that i prints both the lines at the end regardless if they say yes or no, so im wondering how to seprate them and make it only print depending on the awnser the user gives.
take a look at this. http://docs.python.org/tutorial/controlflow.html
ok perfect, thanik you very much. i might be back with more questions :) but thanks for now
your welcome

Not the answer you are looking for?

Search for more explanations.

Ask your own question