#๐ Question
14 messages ยท Page 1 of 1 (latest)
@hardy yoke
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.
not being able to use slicing, parallel list and built-in functions startled me
is there a typo in the first example? Why did the 4 turn into a 3?
oh yeah, the the 3 in the second line is supposed to be 4 i guess
there's 2 (sane) ways you can go about this, store the values you want to swap in two variables (and then repeat this for each swap you want to perform), use the variables to change the values at the respective indexes
(or)
use a neat little trick that allows you to swap the value of two things like so x, y = y, x
that aside, any other parts of the question are you struggling with?
what do they mean by parallel list
you're not allowed to keep a second list variable?
you're not allowed a second list
yes
you have to do the changes in place
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.