I just started a computer course that involves basic Python programming. Unfortunately, I'm not finding it so 'basic'. The first couple of tasks were easier, but I struggling with the next part.
We were given this code as starting point and have to finish it according to the requirements below:
return raw_input('Please say hello: ')
I need to finish the code above so that it satisfies the following requirements:
1. There is a line of code before the loop that sets done to False. Where done represents whether the user has done what was asked of them - that is, they typed hello into the shell when asked
2. There is a while loop that will continue to loop until done is True
3. The function askUserToSayHello is used in the loop to repeatedly ask the user to say hello until they actually do.
4. When the user says hello, the program should print ‘Thanks!’ before finishing. Note that the result of askUserToSayHello can be compared against the equality
operator, which is written as ==
5. When the user says anything else, the program should print some sort of warning
Last edited by micseydel
on Fri Oct 04, 2013 4:59 am, edited 1 time in total.
Reason: First post lock.