+ 1
Hello ! When I use to code, the code playground isn't interactive.. As my "inputs" are empty. How can I solve that?
4 Answers
+ 1
Nahum Maurice
The error exists in your while loop:
while x >= 5:
name_user = input("Hello, please insert your name: ")
print("Hello", name_user )
age_user = int(input("Please, insert your age: "))
list_users_name.append(name_user )
list_users_age.append(age)
x +=1
Firstly, the while asks if x is more than 5, it should be less.
while x >= 5 should be while x <= 5
Secondly, you use an unknown variable for age.
list_users_age.append(age) should be list_users_age.append(age_user)
New while loop code is:
while x <= 5:
name_user = input("Hello, please insert your name: ")
print("Hello", name_user )
age_user = int(input("Please, insert your age: "))
list_users_name.append(name_user )
list_users_age.append(age_user)
x +=1
Similarly, your inputs should be:
Bob
27
Sherry
23
Harrold
56
Susan
19
Jack
32
Mary
39
Hope this helps
https://code.sololearn.com/c8K0xL7Mamvr/?ref=app
+ 2
Thank you so very much. This helps a lot
+ 1
Use a new line for each input you're expected to receive.
+ 1
Hello, thx Rosy and thx Andre Daniel.. Let me show you my code :
https://code.sololearn.com/c5L7vTJ99jt0/?ref=app
I want to know what is wrong with that.. Thx in advance.