0
How can I command the user to enter value of x so condition can be true
x=int(input('enter values :')) if x<=10 : print ('''condition true''') else : print ('''invalid''')
6 ответов
+ 12
Ajay you're looking for something like this??
https://code.sololearn.com/co91kyL5Cihs/?ref=app
+ 2
No you might as well want to use a Boolean like in c++ :
Int x ;
Cin>>x;
While (x!=true ){
Book x = true ;} correct me if I am wrong ☹️
+ 1
Ajay
You can't command the user to do anything.
What you can do is use a try and except block in a while loop so that it will keep asking for input until the condition is met
Something like this:
https://code.sololearn.com/cEAKWLEmjV59/?ref=app
0
But Ithink it is possible in python
- 1
No