+ 1
I want that the user will decide the value of x in the first line.
x=int(input('enter values :')) if x<=10 : print ('''condition true''') else : print ('''invalid''')
20 Réponses
+ 3
Ajay when you x= int(input()) you are changing x value
if you mean you can't change 10 then add y = int(input()) to change y
then
instead of if ( x <= 10 ): change to
if ( x <= y ):
+ 2
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 I was in the heat of the moment 🤣🤣🤣 I am not usually profane. Sorry...
+ 2
Tomiwa Joseph it is sometimes better to step away than bang your head ....
+ 2
it is sometimes better to step away than bang your head ....
Wise words BroFar
+ 1
Tomiwa Joseph words please...
Ajay is new here and may not understand anything at all yet.
0
Ok
0
1) you use ''' ......''' in your print(....). You have the choice only between "......" and '......'
2) actually your code does what you except but if you want the decision in a single line (I do not know if it is what you mean!) use: x=int(input('enter values :\n'))
0
Now code like that to have output . My output is error
But I want like that
Enter value :8
Condition true
0
Can I not change the value of x in kiibo ghayal code
0
I know very good when """...........""" are used in Python!
It is not pythonic to use them to print a single word!
I leave that Forum!!!
0
x=str(input('enter values :'))
x = list(x.split(','))
if len(x) <=10 :
print('''condition true''')
else:
print('''invalid''')
Did you mean this??
0
But how?, kiibo
0
Ajay
You have added comments b in print statement instead of using "'
Use " double quote or ' single quote
- 2
Read it