Hi all,
I am having some issues trying to get my code to detect that there is a blank string(so nothing has been entered)that has been entered in by the user. I am not sure if i am using the wrong function or what is going on.
The question that i am trying to complete is "Write a program that prompts for and reads strings until an empty string is entered,then prints the longest string that was entered. The output must match the punctuation exactly (including quote marks)."
My Code:
Thanks in advance!
I am having some issues trying to get my code to detect that there is a blank string(so nothing has been entered)that has been entered in by the user. I am not sure if i am using the wrong function or what is going on.
The question that i am trying to complete is "Write a program that prompts for and reads strings until an empty string is entered,then prints the longest string that was entered. The output must match the punctuation exactly (including quote marks)."
My Code:
time = 1 user_inputs = [] while time > 0: user_inputs.append(input("Enter a number")) if (user_inputs == ""): print("User_Input is empty") #this is here for testing purposes to make sure the code actually works. time = 0 print(max(user_inputs))Some help would be appreciated.
Thanks in advance!
