+ 1

Was i wrong ?

I was doing python learning course when i got this code and was asked for output def order(): def prepare(): return "Your meal is being prepared!" status = prepare() return status order() When i chose the otion that said No Output the module said it was a wrong answer. Can someone explain ?

6th Jun 2024, 2:50 PM
Ashish Ch
Ashish Ch - avatar
3 Antworten
+ 5
Ashish Ch , it would be helpful if you could share some more details: > platform you are working on: ios, android, web > name of the python tutorial (if it is from sololearn) > name of the lesson / exercise as already mentioned by Ipang, the print statement is missing. instead of just calling order(), you can try: print(order())
6th Jun 2024, 7:18 PM
Lothar
Lothar - avatar
+ 3
If that was all there is in the code, you were right to say that there is no output, for there was no call to print() function.
6th Jun 2024, 5:10 PM
Ipang
0
Why are you defining one function within another?
6th Jun 2024, 3:28 PM
Wilbur Jaywright
Wilbur Jaywright - avatar