0

31.2 practice python 3 what's wrong with my code

what is wrong with my code in " just say it " if c == c : print ("ok") else : print ("Not supported")

14th Jul 2022, 5:21 PM
Mazen
5 Answers
+ 4
c is not defined before if statement.
14th Jul 2022, 6:19 PM
JaScript
JaScript - avatar
+ 2
Post the code question. so we can help
14th Jul 2022, 5:40 PM
MATOVU CALEB
MATOVU CALEB - avatar
+ 2
First you need to take a input. Next check if it is in the list of Commands, which are already given in half code to you. if in list print "Ok" Else print "Not Supported" edit : what your c there?
14th Jul 2022, 8:18 PM
Jayakrishna 🇼🇳
+ 1
MATOVU CALEB These are the instructions: “You’re making a voice recognition system. The supported commands are stored in a list. Complete the program to take a command as input, check if it’s supported and output "OK", if it is, and "Not supported", if not. Sample Input Lights Off Sample Output OK” ———————————— And the code starts like this: commands = ["Lights Off", "Lock the door", "Open the door", "Make Coffee", "Shut down"] #your code goes here
14th Jul 2022, 8:45 PM
Hamsdino
Hamsdino - avatar
0
c = ["Lights Off", "Lock the door", "Open the door", "Make Coffee", "Shut down"]
15th Jul 2022, 4:26 AM
Mazen