#๐ Rock paper scissors
40 messages ยท Page 1 of 1 (latest)
@feral topaz
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.
...
You may have wanted parentheses and not brackets.
} this one?
First.
You're trying to call random.randint
line 15
Calls generally mean you're using parentheses.
!e ```py
import random
choices = 'Apples', 'Pears', 'Bananas'
choice = random.choice(choices)
print(choice)```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Bananas
Some food for thought.
Wait lemme test this real quick
!e if Uw > Cw:
print("You won!")
elif Cw > Uw:
print("You lost")
elif Cw == Uw:
print("It's a tie!")
:x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | if Uw > Cw:
004 | ^^
005 | NameError: name 'Uw' is not defined
Oh
Yea I didn't copy whole code
!e command = ""
started = False
while True:
command = input("> ").lower()
if command == "start":
if started :
print("Car already started!")
else:
started = True
print("Car started")
elif command == "stop":
if started :
started = False
print("Car stopped.")
else:
print("Car already stopped!")
elif command == "quit" :
print("Game ended")
break
elif command == "help" :
print('''
start - start car
stop - stop car
quit - quit game''')
Hey @feral topaz!
It looks like you are trying to paste code into this channel.
You seem to be using the wrong symbols to indicate where the code block should start. The correct symbols would be ```, not '''.
Here is an example of how it should look:
```
Hello, world!
```
This will result in the following:
Hello, world!```
You can **edit your original message** to correct your code block.
:x: Your 3.12 eval job has completed with return code 1.
:warning: Note: input is not supported by the bot :warning:
001 | > Traceback (most recent call last):
002 | File "/home/main.py", line 4, in <module>
003 | command = input("> ").lower()
004 | ^^^^^^^^^^^
005 | EOFError: EOF when reading a line
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 |
002 | this discord server is great
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 |
002 | This is the best discord server
@feral topaz
!e ```py
print('Hello, world.')
print('Goodbye.')
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.