#๐Ÿ”’ error "hello world!" help pls

16 messages ยท Page 1 of 1 (latest)

quaint grotto
mental citrusBOT
#

@quaint grotto

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

wintry lake
# quaint grotto

Why is your question an image of text.

Also, the error says it's looking for a function called hello. What is the code you're submitting? Do you have a function called hello?

quaint grotto
wintry lake
#

No. A function is defined using def.

#

(Usually)

#
def some_function():
    pass

some_function is a function.

#

A function is code that's meant to be executed later. For the above function, you'd call it to run the code, and to call it, you'd do some_function()

#

They're presumably wanting you to write a function that prints Hello World when it's called.

quaint grotto
wintry lake
quaint grotto
wintry lake
# quaint grotto Yes, I'm really new to programming and I don't know anything, I thank you for yo...

You're welcome.

And not off the top of my head. When in doubt though, Real Python is generally quite good:

https://realpython.com/defining-your-own-python-function/

In this tutorial, you'll learn how to define and call your own Python function. You'll also learn about passing data to your function, and returning data from your function back to its calling environment.

quaint grotto
#

thx

mental citrusBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.