w=[] r=0 t=0 q=int(input("How Many Numbers You Wanna Enter: ")) for i in range(q): e=input("Enter A Word: ") if e.isalpha==True: for i in e: if i==" ": print("Enter A WORD Not A SENTENCE") continue else: w.append(e) else: print("Use Alphabets Only") continue for i in w: r=len(i) if t<r: t=r else: continue for i in w: if len(i)==t: print("Longest Word Is: ", i) else: continueThis Code Is For Printing The Longest Word In A List Of Words. Instead Of Using continue, I Wanna Do Something Do Repeat The Iteration, Like When The User Enter A String With Space Or A Digit, The User Is Prompted Again To Enter The Same Value. Using break Will Stop The Whole Program, Which I Definitely Not Wanna Do. What Should I Do? Please Help
Complex Jumping In Code
Messages In This Thread |
Complex Jumping In Code - by WhamDie - Mar-15-2020, 07:52 AM
RE: Complex Jumping In Code - by Larz60+ - Mar-15-2020, 08:06 AM
RE: Complex Jumping In Code - by buran - Mar-15-2020, 08:16 AM
RE: Complex Jumping In Code - by WhamDie - Mar-15-2020, 09:58 AM
RE: Complex Jumping In Code - by buran - Mar-15-2020, 10:04 AM
RE: Complex Jumping In Code - by ndc85430 - Mar-15-2020, 10:36 AM
RE: Complex Jumping In Code - by WhamDie - Mar-15-2020, 10:43 AM
RE: Complex Jumping In Code - by ndc85430 - Mar-15-2020, 06:59 PM
RE: Complex Jumping In Code - by buran - Mar-15-2020, 07:03 PM
RE: Complex Jumping In Code - by snippsat - Mar-15-2020, 10:03 PM
|
Users browsing this thread: 3 Guest(s)