#๐ Help me with my homework
40 messages ยท Page 1 of 1 (latest)
@latent oar
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.
Hey @latent oar!
It looks like you're trying to paste code into this channel.
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
num = int(input("Please type in a number: "))
while True:
if num == 1:
print(num)
break
cnum = 2
cnum2 = cnum - 1
while cnum <= num:
print(cnum)
cnum += 2
print(cnum2)
cnum2 += 2
if cnum == num:
break
elif cnum > num:
print(num)
break
Help pls
What's the issue you're having?
so basically when i input 6
the output is
2
1
4
3
6
5
6
there is a extra 6
cuz i put the print(num) at the bottom
but without that
Ah you probably want to use range
if i input 5
the output just
2
1
4
3
uhh not allowed
What's allowed?
just use while loop
Can you show the full rules?
Yes
well its allowed
it just i wanna try
with while loop
cuz i havent learned for loop
No I mean what's the spec of the assignment, just paste it here
this?
Yes, show more of the assignment prompt
In your screenshot include the whole app including title bar
uhh well
its not rlly an assignment
it just a exercise.i found in website
so can u help me?
alright if for loops
how to do it?
nvm bro
thanks
i solved it
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.
๐ Help me with my homework