#๐Ÿ”’ Can anyone help easy question

15 messages ยท Page 1 of 1 (latest)

olive peak
#

My VERY basic code is not working and I have no clue why.

potent reefBOT
#

@olive peak

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.

dusky pike
#

Swap 1. and 2. line

paper spoke
#

Python always executes your program in a sequence, from the first line forwards. When it starts from the first line, it has no idea what the others are doing, and so it doesn't know what the variable message is

olive peak
#

Big thanks and why is this?

dusky pike
#

Message variable is assigned after you are trying to replace string inside

#

It must be in chronological order

olive peak
#

So basicly it needs to know the message before using it in a print code

dusky pike
#

You have to assign the value first

olive peak
dusky pike
#

By doing

message = "String"
paper spoke
#

It's like saying




The sentence is Adolf```
But python has to do the first part first, it just can't wait until you say what the sentence is
olive peak
#

alright what should be the next thing a learn after this

potent reefBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.