#๐Ÿ”’ help with the "if" statement, how do i do the spaces in between

34 messages ยท Page 1 of 1 (latest)

grizzled cypress
#

i cant figure out how to attach things with the spaces

normal arrowBOT
#

@grizzled cypress

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.

grizzled cypress
#
@commands.has_permissions(administrator=True)
@bot.command()
async def settings(ctx, x, y):
   global configdel
   global hide_NSFW

   if x == "configdelchannel":
        if y == "1":
            configdel = True
            await ctx.send("Successfully turned 'delchannel' on")
        elif y == "0":
            configdel = False
            await ctx.send("Successfully turned 'delchannel' off")
        else:
            await ctx.send("Wrong input: return '1' or '0'")
   
        
        elif x == "hidensfw":
        if y == "1":
            hide_NSFW = True
            await ctx.send("Successfully enabled NSFW commands")
        elif y == "0":
            hide_NSFW = False
            await ctx.send("Successfully disabled NSFW commands")
        else:
            await ctx.send("Wrong input: return '1' or '0'")
    else:
        await ctx.send("Wrong input: 'viewsetting' to view setting sub commands")
weak crypt
#

This is the same screenshot you posted yesterday/this morning.

#

I thought we resolved this.

grizzled cypress
#

its not really it

#

not i dont think so

#

its different

weak crypt
#

This has the same indentation issue. The if is indented by three spaces, while the else is indented by four, which is why there's an error on the else line.

grizzled cypress
#

i wanna connect the x ==

#

things together

#

on the same line

minor idol
#

and keyword?

grizzled cypress
#

how did i just solve it

#

๐Ÿ˜ญ

#

i gain superpowers right after posting

#

anyway gentlemna i solved my issue

#

duck

#

why is everybody invisible here?

weak crypt
#

That was like a month ago though, so I can probably set it to back online.

grizzled cypress
#

block them ig

minor idol
#

bruh

weak crypt
#

In retrospect, ya, I should have just done that.

grizzled cypress
#

is there a chance ill catch u on the sub if i post?

#

theres literally a law that forces all apss that allow users to text each other to have a block button

weak crypt
grizzled cypress
#

what u writtin

weak crypt
#

I'm learning WebAssembly in Rust. So, running compiled Rust code in the browser.

grizzled cypress
#

my cousin said that theres a discord.py club in my city like no way im believing that ๐Ÿ˜ญ

weak crypt
#

Can't speak for that.

grizzled cypress
#

like python? ye but not discord ๐Ÿ˜‚

normal arrowBOT
#
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.