#๐Ÿ”’ can someone help me

70 messages ยท Page 1 of 1 (latest)

naive bridgeBOT
#

@mortal hull

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.

leaden ravine
#

Hi
can you show the output?

mortal hull
#

what like what happenes after it runs

pallid maple
#

please post code as text, and post code that exhibits the behaviour you describe, and describe what you expect and what's different

#

it's impossible to reply to what you've said so far

mortal hull
#

shots_fire = input('how many times do you want to shoot it? ')
elif shots_fire == '3.4.5.6.7.8.9':
print('''its dead but still stuck to the post it got stuck on
its kind of disgusting
now thats dead do you want to,''')
act = input('(back) (open the orange crate)')

 if act == 'b':
      pervomayRoute()
pallid maple
#

that isn't valid syntax

leaden ravine
#
shots_fire = input('how many times do you want to shoot it? ')
elif shots_fire == '3.4.5.6.7.8.9':
     print('''its dead but still stuck to the post it got stuck on 
                its kind of disgusting
                now thats dead do you want to,''')
     act = input('(back) (open the orange crate)')

     if act == 'b':
          pervomayRoute()
#

you can write code this way

print("Hello worlds")
pallid maple
#

you have an elif without an if

leaden ravine
#

is it an entire code?

pallid maple
#

I'm also wondering why you changed from commas to periods, as well as whether you think the commas will in some way test if the given input is any of those values

mortal hull
#

that was an accident

#

and above that code is just this

#

def pervomaRoute_Tower():

print('''you have climbed up the ladder and see a grey, miserable 
      wastleland for miles and next to your feat you see a orange crate
      your about to open it when suddenely a wierd blob jumps at you
      it sticks onto the wall and stops moving for a brief period of time
      now is your chance check your inventory and see if you have something to kill it''')
act = input('(inventory)')
if act == 'i':
     sortInventory()
     print(' ')
     for i in inventoryWeapons_S:
        print(i)
     print(' ')
     for i in inventoryConsumables_S:
        print(i)
     print(' ')
     for i in inventoryRandom_S:
        print(i)
leaden ravine
#

Oli, try to write code, the way the bot suggested

#

it much easier to read for us

mortal hull
#

let me see how the bot suggests it

leaden ravine
pallid maple
#

it's not so much about ease of reading as it is not knowing what you're doing at all because we're not given an intact copy of it -- plus the thing about how we have no idea what you expect to happen

mortal hull
#

it should say after the shots_fire

pallid maple
#

that is much too vague.

mortal hull
#

the text in the print then the two options back or open the orange crate

leaden ravine
#

we still do not have the code man

mortal hull
#

im trying i starting coding yesterday

leaden ravine
#

ok

mortal hull
#

can we just vc and i shair my screen because i just dont know

leaden ravine
#

try to write the quotes and paste code inside of it

mortal hull
#

huh

pallid maple
#

discord's text input accepts formatting specifiers for bold/italic as well as performing other transformations like messing with space - if you just paste code in without telling discord it's code, then it's going to change the code

leaden ravine
#

`

#

this quotes

mortal hull
#
        
              

            
def pervomaRoute_Tower():
    
    print('''you have climbed up the ladder and see a grey, miserable 
          wastleland for miles and next to your feat you see a orange crate
          your about to open it when suddenely a wierd blob jumps at you
          it sticks onto the wall and stops moving for a brief period of time
          now is your chance check your inventory and see if you have something to kill it''')
    act = input('(inventory)')
    if act == 'i':
         sortInventory()
         print(' ')
         for i in inventoryWeapons_S:
            print(i)
         print(' ')
         for i in inventoryConsumables_S:
            print(i)
         print(' ')
         for i in inventoryRandom_S:
            print(i)
        
     
            shots_fire = input('how many times do you want to shoot it? ')
            if shots_fire == '3.4.5.6.7.8.9':
             print('''its dead but still stuck to the post it got stuck on 
                its kind of disgusting
                now thats dead do you want to,''')
             act = input('(back) (open the orange crate)')

             if act == 'b':
                   pervomayRoute()
naive bridgeBOT
#

Hey @mortal hull!

It looks like you pasted Python code without syntax highlighting.

Please use syntax highlighting to improve the legibility of your code and make 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.
pallid maple
#

what you need to do is to provide a minimal complete example of what you're talking about, that others can copy and run directly, or even if they don't run it, to see what you're at all talking about because they just. don't. know.

mortal hull
pallid maple
#

can't run that, it uses other functions that you haven't included. can you edit it to not include those, or if they're relevant, then you'll need to share those too

#

maybe THIS is the only part you care about:

shots_fire = input('how many times do you want to shoot it? ')
if shots_fire == '3.4.5.6.7.8.9':
 print('''its dead but still stuck to the post it got stuck on 
    its kind of disgusting
    now thats dead do you want to,''')
 act = input('(back) (open the orange crate)')
mortal hull
#

ye

pallid maple
#

don't share any of the rest then.
and you're still missing:

  1. what input are you writing on stdin
  2. what happens differently from what you expect
mortal hull
#

for the first point im witing on microsoft studio because me and my friend is working on it

pallid maple
#

!e

import io, sys
sys.stdin = io.StringIO("3.4.5.6.7.8.9")

shots_fire = input('how many times do you want to shoot it? ')
if shots_fire == '3.4.5.6.7.8.9':
 print('''its dead but still stuck to the post it got stuck on 
    its kind of disgusting
    now thats dead do you want to,''')
naive bridgeBOT
pallid maple
#

as shown there, the words in the print command, as you described it, do print out.

#

you said they don't print out. maybe you didn't use the same input as I did, but you haven't said what input you did use

mortal hull
#

and it doesnt give the options of back or open the crate and it dosent show the bit of dialog after

mortal hull
pallid maple
#

you call input, the user has to write something, and then that code acts on what the user writes.
so what the user writes affects how it runs
therefore you have to say what the user writes

#

if the user writes:
4
then 4 is not equal to 3.4.5.6.7.8.9 so the comparison would evaluate to False and thus the print won't get called

mortal hull
#

it just needs to be anything 3 or above

pallid maple
#

4 is a length 1 string, 3.4.5.6.7.8.9 is a length 13 string, they're not gonna be equal, there's no logic here for "any of"

#

you'll need to compare to each of those in turn

#

x == "3"
x == "4"
x == "5"
...
and then combine the results into a single result, that would be with the operator or, or tests if the left side OR the right side is True

pallid maple
#

@mortal hull I saw your dm now - address the channel instead of specific people :x

mortal hull
#

My bad

#

Anyways I have to go because it's getting late

pallid stone
#

i heard help

#

you got it?

#

Siqius the goat is typing...

autumn tusk
#

and more readable

pallid maple
#

one can start abstracting after working out the basics

autumn tusk
#

being taught

if x == "1" or x == "2" or x == "3" ...

is never a good idea

#

its much better to learn how to create readable code from early on

pallid maple
#

that is what gets executed at the end of the day

autumn tusk
#

but one of them is way more readable than the other

pallid maple
#

understanding the logic one is writing comes first

autumn tusk
#

i agree that its important to know the basics but writing so many statements becomes unreadable and very annoying

naive bridgeBOT
#
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.