0

Function lesson

def hello(): print("Hello world!") hello() How is this code wrong? It will not let me continue! Please help

24th Sep 2023, 10:22 PM
Brian
13 Respostas
+ 6
Brian the closest I can see in that lesson is def hello(): print("Hi!") Can you share the location of the above code you mention...
24th Sep 2023, 10:59 PM
BroFar
BroFar - avatar
+ 5
Abdelrhman Hesham Marzouk please do not provide chatgpt responses. This is neither warranted nor wanted in an e-learning environment where community members help community members based off personal knowledge and experience.
26th Sep 2023, 3:08 AM
BroFar
BroFar - avatar
+ 3
Brian at this point I would screenshot the lesson your code and the attempt / results ... And forward all details to info@sololearn.com So they can get to the bottom of the issue. Python core course was removed from the catalog and was on the old learning engine so that may be the cause of the error and the replacement courses are the introduction to python course and intermediate python course ... on the current learning engine.
25th Sep 2023, 7:03 PM
BroFar
BroFar - avatar
+ 2
Python Core Lesson 2 under Functions & Modules.
25th Sep 2023, 12:58 AM
Brian
+ 2
Is it as Aaron mentioned second to last page? If that is it, did you comment out the function call before the function is defined?
25th Sep 2023, 2:14 AM
Wong Hei Ming
Wong Hei Ming - avatar
+ 2
after emailing info@sololearn.com, it magically worked once I did the right sequence! I was doing things in the wrong order. I started this module last year so my memory was foggy to the rhythm and how things worked. I'm good now
26th Sep 2023, 4:05 AM
Brian
+ 2
Brian glad to hear and thank you for the update.
26th Sep 2023, 4:17 AM
BroFar
BroFar - avatar
+ 1
Brian the second to last page? With the code playground?
25th Sep 2023, 1:35 AM
Aaron Lee
Aaron Lee - avatar
+ 1
Yes, that's the correct location. " Functions You must define functions before they are called, in the same way that you must assign variables before using them. CODE PLAYGROUND: PY hello() def hello(): print("Hello world!") Click to run level The given code results in an error. Can you fix it?" I tried everything, including commenting out the function call as you mentioned. It still will not let me past this section. I've literally tried ALL the comment suggestions too (that were in English) It simply will NOT let me through.
25th Sep 2023, 5:30 PM
Brian
+ 1
I have run every iteration of that code forever. i hit Run and NOTHING happens. There is something wrong. I copy and pasted your EXACT code into the lesson and nothing happened. I deleted the comments too, NOTHING I JUST WANT TO HIT THE CONTINUE BUTTON!!!! (It's still greyed out)
25th Sep 2023, 6:38 PM
Brian
+ 1
Let me clarify: i do indeed get the Hello world output I just wanna move on with the lesson. I also have done the right practice with inputting Tommy as the name for +5 exp What else do I need to do?
25th Sep 2023, 6:41 PM
Brian
+ 1
Hey! Alright!
26th Sep 2023, 4:19 AM
Aaron Lee
Aaron Lee - avatar
0
If you make your code look like this will it work? https://code.sololearn.com/cf8OVf9Mqjo3/?ref=app
25th Sep 2023, 5:39 PM
Aaron Lee
Aaron Lee - avatar