+ 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" )

20th Dec 2020, 8:08 AM
Dedipyaman Bhattacharjee
Dedipyaman Bhattacharjee - avatar
26 odpowiedzi
+ 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!
20th Dec 2020, 8:13 AM
noteve
noteve - avatar
+ 6
Dedipyaman Bhattacharjee Python is case sensitive. You can't write youtube to YouTube. If you write then it will not work.
20th Dec 2020, 8:27 AM
A͢J
A͢J - avatar
+ 4
Dedipyaman Bhattacharjee It's taking just write hi open youtube And press enter button
20th Dec 2020, 8:25 AM
A͢J
A͢J - avatar
+ 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.
20th Dec 2020, 8:25 AM
noteve
noteve - avatar
+ 2
Dedipyaman Bhattacharjee No we can't believe. If you did the same as we said then it will work.
20th Dec 2020, 8:31 AM
A͢J
A͢J - avatar
+ 2
Dedipyaman Bhattacharjee Both are working but now we are not going to entertain you. Happy Coding.
20th Dec 2020, 8:33 AM
A͢J
A͢J - avatar
+ 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
20th Dec 2020, 8:16 AM
Manash Saikia [ 45% Active ]
Manash Saikia [ 45% Active ] - avatar
+ 1
open youtube
20th Dec 2020, 8:19 AM
noteve
noteve - avatar
+ 1
It is working, It is just that here in Code Playground the input(s) are/is only taken once.
20th Dec 2020, 8:24 AM
noteve
noteve - avatar
+ 1
Dedipyaman Bhattacharjee Don't do joke with us. It will work if you have taken same value.
20th Dec 2020, 8:29 AM
A͢J
A͢J - avatar
+ 1
Believe me
20th Dec 2020, 8:29 AM
Dedipyaman Bhattacharjee
Dedipyaman Bhattacharjee - avatar
+ 1
Python is case sensitive. You can't write youtube to YouTube. If you write then it will not work.
21st Dec 2020, 6:20 PM
Shiv-20
Shiv-20 - avatar
0
Please elaborate
20th Dec 2020, 8:14 AM
Dedipyaman Bhattacharjee
Dedipyaman Bhattacharjee - avatar
0
But it's not working for open YouTube
20th Dec 2020, 8:17 AM
Dedipyaman Bhattacharjee
Dedipyaman Bhattacharjee - avatar
0
I will
20th Dec 2020, 8:19 AM
Dedipyaman Bhattacharjee
Dedipyaman Bhattacharjee - avatar
0
Please let me know
20th Dec 2020, 8:21 AM
Dedipyaman Bhattacharjee
Dedipyaman Bhattacharjee - avatar
0
Can't understand
20th Dec 2020, 8:21 AM
Dedipyaman Bhattacharjee
Dedipyaman Bhattacharjee - avatar
0
Why the program is not working in python
20th Dec 2020, 8:22 AM
Dedipyaman Bhattacharjee
Dedipyaman Bhattacharjee - avatar
0
It's not taking YouTube
20th Dec 2020, 8:24 AM
Dedipyaman Bhattacharjee
Dedipyaman Bhattacharjee - avatar
0
No I had written same to same
20th Dec 2020, 8:27 AM
Dedipyaman Bhattacharjee
Dedipyaman Bhattacharjee - avatar