#๐ If statement
70 messages ยท Page 1 of 1 (latest)
@dusky lintel
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.
Do you mean in the case where the current if is false
yes
Backspace
are you not able to use an IDE?
whats IDE (im new to programming
It's for coding longer scripts
If you want a totally separate if
would you like an installation guide?
i have to use idle
Hit enter on the blank line
I see

so idk
Do you know what that means
no
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
i wrote it before
Press enter once more.
what happens when you type
>>> age
You shouldn't be using a REPL to write code. When you see >>>, you're in what's called a "REPL" (Read, Evaluate, Print, Loop). The purpose of REPLs is to run (usually) single lines of code at a time to see what happens. They are not meant for multiple writing multiple lines of code.
Go to File and then I think New File and create an actual file to write your code in. From there, you can press F5 to run the contents of the file. This has the benefit that it won't try to run the code every time you press enter.
not meant for multiple lines of code? Iโve been doing repl wrong
Well, not meant to write a lot of code. Usually, it's to run a small snippet, either to test a larger codebase, or run a line or two in isolation. If you want to write and execute multiple lines of code, saving the code to a file is usually easier unless you're using a notebook environment.
I have run multi-line statements in the standard Python REPL, but it is not ideal in my experience. I'll create an runnable fine pretty readily if I'm trying to run anything that spans multiple lines.
I should also mention, REPLs can be used for running pasted code that's many lines long, but that's not the case here.
How do you even submit your code?
are you not allowed to create a python file and code in that?? (ctrl+n)
I'm just gonna interject
If you're not familiar with the idea, you should be writing your code in an IDE - Integrated Development Environment
Which is a fancy way of saying "supercharged text editor designed specifically for code"
I mention this so I can expand on Carcigenicate's answer: there are very few instances where you'd actually want to write "live code." That is, if you see the ">>> " you're in an "interactive" coding environment. You don't want that
so much REPL hate in this thread lol. it's great for learning. the environment wasn't his issue
Not hate exactly XD Its just that you've got to use the right tool for the job
prob just forgot he set "age" in a different instance
but not great for submitting your work
they said "I have to use IDLE", which indicates they didn't really understand that the REPL can be running inside of IDLE, and that there is another option than the REPL
yeah idk. i was just interested in seeing them work out the problem
but they abandoned us
@dusky lintel are you working on doing the things that people have mentioned, or are you MIA?
Iโm just gonna ask the professor tomorrow, I think they will give us time in class to work on the problem
But idle is what we've been using the whole time

did you even read what I said?
Idk what MiA is
Missing in Action
they said "I have to use IDLE", which indicates they didn't really understand that the REPL can be running inside of IDLE, and that there is another option than the REPL
there is the "IDLE Shell" which is the REPL. You can also edit files in IDLE
Ok i ll try tomorrow thank you tho
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.