#๐ how to make a different randon number every time?
22 messages ยท Page 1 of 1 (latest)
@waxen plover
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.
put the begamt = random.randint() inside your function
alr lemme try tat
Make it so each time you call it it randint()s again
also an fstring would look nicer here
yup
smth like this?
No
srry im kinda new
use fstring's ability to directly slot variables into it, like
!e
num = 10
print(f'I have a number: {num}')
@dusty steeple :white_check_mark: Your 3.12 eval job has completed with return code 0.
I have a number: 10
you didn't put the randint into the function there
inside your function... your function begins at the "async def" line.. so it needs to be after that, and indented
maybe, if you cannot use basic concepts lijke function, you should improve it before doing such elaborated things like discord bot
@client.command()
async def beg(ctx):
begamt = random.randint(10, 300)
await ctx.reply(f"{ctx.author.mention} begged and received ${begamt}")
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.