#๐ can someone help me
70 messages ยท Page 1 of 1 (latest)
@mortal hull
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.
Hi
can you show the output?
what like what happenes after it runs
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
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()
that isn't valid syntax
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")
you have an elif without an if
is it an entire code?
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
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)
let me see how the bot suggests it
I also send it here
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
it should say after the shots_fire
that is much too vague.
the text in the print then the two options back or open the orange crate
we still do not have the code man
im trying i starting coding yesterday
ok
can we just vc and i shair my screen because i just dont know
try to write the quotes and paste code inside of it
huh
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
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()
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.
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.
like that?
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)')
ye
don't share any of the rest then.
and you're still missing:
- what input are you writing on stdin
- what happens differently from what you expect
for the first point im witing on microsoft studio because me and my friend is working on it
!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,''')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | how many times do you want to shoot it? its dead but still stuck to the post it got stuck on
002 | its kind of disgusting
003 | now thats dead do you want to,
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
and it doesnt give the options of back or open the crate and it dosent show the bit of dialog after
because i dont know what you mean
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
it just needs to be anything 3 or above
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
@mortal hull I saw your dm now - address the channel instead of specific people :x
if x in ["1","2",...] would be better
and more readable
one can start abstracting after working out the basics
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
that is what gets executed at the end of the day
but one of them is way more readable than the other
understanding the logic one is writing comes first
i agree that its important to know the basics but writing so many statements becomes unreadable and very annoying
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.