After breaking a statement,, how to you make your code start reading from next line | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

After breaking a statement,, how to you make your code start reading from next line

User1 = input("Enter your Name: ") User2 = input("Enter your Name: ") User3= input("Enter your Name:") User4= input("Enter your Name: ") User5 = input("Enter your Name:") street = input("Enter your Date of birth: ") street = input("Enter your Date of birth: ") street = input("Enter your Date of birth: ") street = input("Enter your Date of birth: ") street = input("Enter your Date of birth: ") while True: num = input('Enter age for all users separated by a comma: ') n = num.split(',') print(n) if len(n) >=2: for i in range(len(n)): highest = max(n) lowest = min(n) print('Oldest person: ' + highest) print('youngest person: ' + lowest) else: print("Please, at least enter 2 numbers separated by ','") break

9th Mar 2021, 6:28 PM
Ojukwu Franklin Ifeanyi
Ojukwu Franklin Ifeanyi - avatar
9 Answers
+ 1
Why don't you use functions (def) ✌
11th Mar 2021, 4:17 AM
Sanjay Kamath
Sanjay Kamath - avatar
0
hmm this one hard sir
9th Mar 2021, 6:34 PM
☯【 x e n o z 】☯
☯【 x e n o z 】☯ - avatar
0
Move break before else, inside if statement with indent
9th Mar 2021, 6:36 PM
Kodirbek Makharov
Kodirbek Makharov - avatar
0
Could you simplify your question? How could we help you? What do you need? Keep it simple,
9th Mar 2021, 6:49 PM
▲TopGun ▲
▲TopGun ▲ - avatar
0
▲TopGun ▲ i want to end the while statement and proceed with more codes down,, but the break statement is executing d program as "finished"
9th Mar 2021, 6:51 PM
Ojukwu Franklin Ifeanyi
Ojukwu Franklin Ifeanyi - avatar
0
Kodirbek Makharov hve tried it before,, dint work
9th Mar 2021, 6:51 PM
Ojukwu Franklin Ifeanyi
Ojukwu Franklin Ifeanyi - avatar
0
You can try "return" function. x=0 while x < 10: x=x+1 return x
9th Mar 2021, 6:55 PM
▲TopGun ▲
▲TopGun ▲ - avatar
0
▲TopGun ▲ returning outside a function
9th Mar 2021, 7:25 PM
Ojukwu Franklin Ifeanyi
Ojukwu Franklin Ifeanyi - avatar
0
If understood well ur question, you need your code to restart its logic after a condition or exception is met, hence, you need to use <<try except continue>> block https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/python_try_except.asp
10th Mar 2021, 12:37 AM
iTech
iTech - avatar