#🔒 attwmpting to code rock papwr scissors

81 messages · Page 1 of 1 (latest)

fresh badger
#

first project :3

timber basaltBOT
#

@fresh badger

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.

fresh badger
#

i have no idea what im doing

#

:3

pastel crag
#

you might need to try a simpler project first, like fizzbuzz, rock paper scissors, etc

fresh badger
#

ok

#

attwmpting to code rock papwr scissors

#

how do i do this then

#

im pretty clueless

fallen frigate
#

How much programming do you know so far?
Do you know print for example?

fresh badger
#

i can

#

idk

#

!e

print(x)
timber basaltBOT
fallen frigate
#

Great!

#

Do you know about input() ? You’ll need that to get an input out from the player.

fresh badger
#

!e

x=random.randint(1, 10)
print(x)
timber basaltBOT
fresh badger
#

!e

x=random.randint(1, 10)
print(x)
timber basaltBOT
fresh badger
#

ok it is random

fallen frigate
fallen frigate
#

It’ll be easier for you to start with the second player being real

fresh badger
#

ok

fallen frigate
#

And then convert the second player to a computer later

fresh badger
#

wait 1min

fresh badger
#

yes

#

!e
x=input(str("please choose an option":))

timber basaltBOT
fallen frigate
#

Yes, other than the syntax error that is it

fresh badger
#

the bot does not like input?

fallen frigate
#

It can’t request input from you, but also you are typing it out slightly wrong

fresh badger
#

oh

fallen frigate
#

Here’s where you should read the error it’s telling you

fresh badger
#

ohh

fallen frigate
#

I would tell you, but it’s best if I don’t. This is where real learning happens.

fresh badger
#

fixed

fallen frigate
#

Great! Let’s see the fixed version.

fallen frigate
#

I don’t see it fixed there

fresh badger
#

colon after quote mark?

fresh badger
#

oh

fallen frigate
#

What does the error say?

fresh badger
#

there

#

i forgor the bracket

fallen frigate
#

Yes

fresh badger
#

im also doing python in classes

#

:3

fallen frigate
#

Though you don’t need the str() there actually

fresh badger
#

oh

fallen frigate
#

Because you already defined a string in double quotes

fresh badger
#

oh

fallen frigate
#

" hello world "
This is already a string

fresh badger
#

yes

fallen frigate
#

But it works so it’s fine for now

#

Do you know if/elif/else?

fresh badger
#

i think

#

!e

y=8
if x>y:
 print("x in larger than y")
elif x<=y:
 print("x is smaller or equal to y")```
fallen frigate
#

You can’t have elif on its own

fresh badger
#

fixed :3

fallen frigate
#

Yes!

#

But what if x is equal to y?

#

Note - if you want a condition at the end, that’s where you use else.

fresh badger
#

grg for school in a min

#

im on bus atm

timber basaltBOT
fresh badger
#

oop

fallen frigate
#

Well, this is all we need to talk about anyway.
With input(), if/elif/else and print(), you can do a two player rock/paper/scissors with both as humans

#

So try it out when you can!

#

Put all of those together to make that program

fresh badger
#

ok

#

cya

#

gtg now

fallen frigate
#

👋

trim bronze
timber basaltBOT
#
Python help channel closed for inactivity

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.