Python bad input line 11

531
January 29, 2017, at 2:50 PM
largest = none
smallest = none
inp = None
while True:
    inp = raw_input("Enter an integer: ")
    try:
        final_output = int(inp)
        if (final_output > largest):
            largest = final_output
        elif (final_output < smallest):
            smallest = final_output
        elif (inp == "done"):
            break
        elif (inp > 0):
            continue 
    except ValueError:
        print "Invalid input"

print "Maximum is ", largest
print "Minimum is ", smallest
Answer 1

I fixed your code a little bit:

largest = 0
smallest = 0
inp = None
while True:
    inp = raw_input("Enter an integer: ")
    try:
        if (inp == "done"):
            break
        final_output = int(inp)
        if (final_output > largest):
            largest = final_output
        elif (final_output < smallest):
            smallest = final_output
    except ValueError:
        print ("Invalid input")

print "Maximum is ", largest
print "Minimum is ", smallest
Answer 2

You had no actual question, some formatting challenges, and several errors, but here is some code...

import sys
largest = -sys.maxint - 1
smallest = sys.maxint
while True:
    inp = raw_input("Enter an integer: ")
    if (inp == "done"):
        break
    try:
        final_output = int(inp)
        if final_output > largest:
            largest = final_output
        if final_output < smallest:
            smallest = final_output
    except ValueError:
        print "Invalid input"
print "Maximum is ", largest
print "Minimum is ", smallest
READ ALSO
Laravel Eloquent Query - limit on a count()

Laravel Eloquent Query - limit on a count()

I need to know if a table has more than 50 rows fitting some criteriaSo, the raw query should look like this:

469
sqoop vs hdfs commands

sqoop vs hdfs commands

I am a new bie to SqoopAs per my understanding, Sqoop commands are for importing data from database like MySql to HDFs and viceversa and HDFS commands are for dealing with data in HDFS, such as getting data from HDFS to local file system and viceversa

352
How can I get the name of voter from the user&#39;s table?

How can I get the name of voter from the user's table?

Here is my current database structure:

209