so here is the question.
Translate the following pseudocode for finding the minimum value from a set of inputs into a Python program.
Set a Boolean variable "first" to true.
While another value has been read successfully
If first is true
Set the minimum to the value. Set first to false.
Else if the value is less than the minimum Set the minimum to the value.
Print the minimum.
This is what I have so far but it currently takes the input and repeats indefinitely can anyone give thoughts or suggestions on what I'm missing from where?
Translate the following pseudocode for finding the minimum value from a set of inputs into a Python program.
Set a Boolean variable "first" to true.
While another value has been read successfully
If first is true
Set the minimum to the value. Set first to false.
Else if the value is less than the minimum Set the minimum to the value.
Print the minimum.
This is what I have so far but it currently takes the input and repeats indefinitely can anyone give thoughts or suggestions on what I'm missing from where?
#input value and setting boolean variable "first" to true first = True string=input("Please enter any numbers and -1 to finish:") #initialize first to true i = 0 #find the minimum value until sentinel is entered while i < len(string): if first == True: minimum=string first = False elif string < minimum: minimum = string print(minimum)