#๐Ÿ”’ How to get only largest variable to output

13 messages ยท Page 1 of 1 (latest)

woeful yokeBOT
#

Hey @spark snow!

It looks like you're trying to paste code into this channel.

Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes 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.
#

@spark snow

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.

spark snow
#

it spits out all variables instead of the largest one

empty torrent
#

are you searching for max() ?

spark snow
#

N = int(input('Enter an integer:'))

while N < 0 or N > 50000000:
N = int(input('Enter an integer:'))
for i in range (2,N):
if N % i == 0:
print (N, 'is not prime')
print (N // i, 'is the largest factor')
break
else:
print (N, 'is prime')

woeful yokeBOT
#

Hey @spark snow!

It looks like you're trying to paste code into this channel.

Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes 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.
spark snow
#

figured it out

#

boutta close it

#

thanks though

empty torrent
#

!e

print(max(3, 9, -16, 45, 2))
woeful yokeBOT
#

@empty torrent :white_check_mark: Your 3.12 eval job has completed with return code 0.

45
woeful yokeBOT
#
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.