+ 10
Why it's not working in python
greeting = input() greetings = ['hi','hello','Hi','Hello','Wake up','wake up EDITH','wake up'] if greeting in greetings: print ("Hello sir how can I help you") else: print ("Sorry for inconvinence sir ,please put something valid") greeting = input() greetings =['open youtube'] if greeting in greetings: print ("Sorry but I am not made for online pourpose") else: print ("Sorry for inconvinence sir ,please put something valid" )
24 Antworten
+ 8
Try to input like this for example:
hi
open youtube
- - - - - - - - - - - -
As here in SoloLearn Code Playground, the input value is only taken once and for example I have 3 variables that need input:
x = input( )
y = int(input( ))
z = float(input( ))
#Then my input should be like this
string
12
20.5
- - - - - - - - - - - - -
Note that every new line in input means new input variable. If you only input 2 values when the program needs 3, it will cause an error. I hope this helps. Happy Coding!
+ 6
Dedipyaman Bhattacharjee
Python is case sensitive. You can't write youtube to YouTube. If you write then it will not work.
+ 4
Dedipyaman Bhattacharjee
It's taking just write
hi
open youtube
And press enter button
+ 3
Dedipyaman Bhattacharjee
What do you mean?
your list has "open youtube"
so your input must be the same spelling too. Python is a Case-Sensitive Language which means "Python" and "python" are different.
+ 2
Dedipyaman Bhattacharjee No we can't believe. If you did the same as we said then it will work.
+ 2
Dedipyaman Bhattacharjee
Both are working but now we are not going to entertain you. Happy Coding.
+ 1
First write hi in the prompt box. Then click enter button of your keyboard. Then write open youtube. Then submit. It will be work
+ 1
open youtube
+ 1
It is working, It is just that here in Code Playground the input(s) are/is only taken once.
+ 1
Dedipyaman Bhattacharjee
Don't do joke with us. It will work if you have taken same value.
+ 1
Believe me
+ 1
Python is case sensitive. You can't write youtube to YouTube. If you write then it will not work.
0
Please elaborate
0
But it's not working for open YouTube
0
I will
0
Please let me know
0
Can't understand
0
Why the program is not working in python
0
It's not taking YouTube
0
No I had written same to same