#๐Ÿ”’ My reply wont reply after i say what i need to

104 messages ยท Page 1 of 1 (latest)

median lark
devout yachtBOT
#

@median lark

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.

median lark
#

help me pls

umbral cypress
median lark
#

im new

#

can u send the symbol

#

so i know what it is

#

cuz im kinda confused

#

is it ()?

umbral cypress
median lark
#

offfff

#

ohhhhhh

#

i see

#

im stupid

#

thank you

#

im gonna post some more problems here prob

#

do u mind if i ping u when i do?

umbral cypress
median lark
#

kk

tough gazelle
#

the () shouldn't affect it

median lark
#

yea i just checked

#

did nothing

tough gazelle
#

are you typing glock or Glock for the input?

#

Strings are case sensitive

#

glock and Glock will not be equal

median lark
#

im trying Glock

#

i do Glock

#

like what it says

tough gazelle
#

how are you running this? Can you show us a screenshot of your test?

median lark
#

heres a ss

#

thonny

#

cuz thats what my school uses

tough gazelle
#

I haven't used it, but it looks like you might be typing a space before you type Glock?

median lark
#

what do u use

tough gazelle
#

I use sublime or pycharm, but it shouldn't matter for this

#

are you typing a space before you type Glock?

median lark
#

IT WORKS

#

THANK YOU SO MUCH

#

i was in lesson tryna do it for 1h

#

my friend was confused

#

thx bro

tough gazelle
#

np!

median lark
#

do u mind if i ping u if i have more problems??

#

or do i just need to post

#

yo how i fix this cuz i tried some things i search up online but still nothing

silent marsh
#

you're not using input for the second question

median lark
#

??

#

i just started so i dont understand

#

@silent marsh can you please explain??

sweet timber
median lark
#

i need to string the text

#

but idk how

silent marsh
#

you use input(...) (like in your first line), whenever you want to have the user type something

#

and store it in a variable

sweet timber
median lark
#

ohhh i see

#

wait what

#

theres another input

sweet timber
# median lark ohhh i see
buy_gun = False
i = input("What gun do you want to buy today?")
if i == "Glock":
  print("That will be ยฃ50.")
  buy_gun = True
else:
  print("I'm sorry. We don't have that gun here.")
if buy_gun:
  i = input("Do you want to do installments or pay it all at once?")
#

Here's one way to go about doing something similar.

#

First, we create a variable called buy_gun.

#

This will tell the program whether the user wants to buy a gun.

#

Then, the program will ask the user to input what gun they want to buy.

#

If they input "Glock," they will get told the price, and buy_gun will be set to true.

median lark
#

kk

sweet timber
median lark
#

kk

#

i understand

#

can u like explain how u did it tho

#

i see the code

#

but i dont understand what u did

sweet timber
median lark
#

kk thank you

sweet timber
#

The first line declares a boolean variable.

median lark
#

no clue waht a boolean variable is but okay

#

i will go onto google

sweet timber
median lark
#

ohh

#

i see

#

i understand waht a boolean variable is now

sweet timber
#

Next, we ask for the input and save it to i.

median lark
#

kk

sweet timber
#

After that, we enter into an if-else statement.

#

Do you understand how those work? I see you know what an if statement is, but I want to make sure since you seem like a beginner.

median lark
#

i do

#

my friend told me what if statements are

#

im guessing if-else is like a if this is true this happens if this is false this happens

median lark
#

yippiee!!

sweet timber
#

Basically, the if-else statement will first check if the input is "Glock." If it's indeed "Glock," it will print a message and set buy_gun to True.

sweet timber
median lark
#

i see

sweet timber
#

Finally, we enter one last if statement.

#

If buy_gun is true, it'll ask for the user's input again.

#

@median lark, would you like to see something a bit more advanced? It would be a pretty good alternative if you plan on having multiple types of guns.

median lark
#

i think i might try it by myself

#

but if i need help i will dm u

#

but thanks for the offer

#

i learned alot

devout yachtBOT
#
Python help channel closed

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.