Plz help me to find correct code 👇👇 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Plz help me to find correct code 👇👇

https://code.sololearn.com/ckWhHTAt6MHf/?ref=app I see in code coach it give two correct & other incorrect . Where I should be corrected?

27th Oct 2020, 7:29 AM
Chain Sing Maravi
Chain Sing Maravi - avatar
5 Answers
+ 3
persons_ages = [] i = 0 while i<3: pers_age = int(input()) persons_ages.append(pers_age) i+=1 for j in persons_ages: if j>16: print("Get ready!") else: print("Too young!")
27th Oct 2020, 7:40 AM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
+ 1
Remove brake statement. As it enters in for loops and check first age, after giving output it comes out of loop. So remove brake it will run
27th Oct 2020, 7:39 AM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
+ 1
Chain Sing Maravi , unfortunately your question looks incomplete. There is no description what happens by running your code. Do you get an error message or is it just a wrong result? So you expect to check or guess this from people that are going to help you? When is the problem occurring? In which environment do you run the code? (Playground, IDE, ...) Unclear questions and missing or faulty information about a problem can lead to wrong or useless answers. This means wasted time and also bit of frustration for all of us, including the asker.. The conclusion is: An answer can only ever be as valuable as the question was. Thanks for your understanding!
27th Oct 2020, 9:56 AM
Lothar
Lothar - avatar
+ 1
Lothar Sir it gives error in Code coach
27th Oct 2020, 11:34 AM
Chain Sing Maravi
Chain Sing Maravi - avatar
+ 1
ツ Priyanshi ツ {PTP} it's gives error in Code coach playground
27th Oct 2020, 11:36 AM
Chain Sing Maravi
Chain Sing Maravi - avatar