Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue in break #1

Open
sagunraul opened this issue Apr 1, 2020 · 3 comments
Open

issue in break #1

sagunraul opened this issue Apr 1, 2020 · 3 comments

Comments

@sagunraul
Copy link

I am getting issue in break in line no.5 please help me

largest = None
smallest = None
while True:
num = raw_input("Enter a number: ")
if num == "done" :break

try:
num = int(num)
except:
print ("Invalid input")
continue

if largest is None:
largest = num
elif largest < num:
largest = num

if smallest is None:
smallest = num
elif smallest > num:
smallest = num

print ("Maximum is", largest)
print ("Minimum is", smallest)

@ZekeLandon
Copy link

ZekeLandon commented Apr 5, 2020

Hi @sagunraul,

Can you paste your code using Insert Code option so that it becomes easy to tell what's wrong
Also, mention what's your error

Regards,
Zeke

ed-lau pushed a commit that referenced this issue Oct 3, 2020
Update wk1 - assignment 1.1.py
@SHIVANI0708
Copy link

Hi @sagunraul
I have got the problem so can you please tell me how can I tell That to you??

@muduliratikant
Copy link

Hi @sagunraul I have got the problem so can you please tell me how can I tell That to you??

largest = None
smallest = None

while True:
num_input = input("Enter a number: ")
if num_input == "done":
break
try:
num = int(num_input)
if largest is None or num > largest:
largest = num
if smallest is None or num < smallest:
smallest = num
except ValueError:
print("Invalid input")

if largest is not None and smallest is not None:
print("Maximum is", largest)
print("Minimum is", smallest)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants