- 4

I need help with python

I have a project as homework

2nd May 2021, 2:10 AM
afrah ali
afrah ali - avatar
8 Answers
+ 1
afrah ali Do you want to build a traffic light program?
2nd May 2021, 8:50 AM
Sahil
Sahil - avatar
2nd May 2021, 5:30 PM
Sahil
Sahil - avatar
+ 1
*The program is made only for demonstration purposes
3rd May 2021, 5:29 AM
Sahil
Sahil - avatar
0
I have to biuld expert system, i cant do the rules Sorry my english is not good
2nd May 2021, 2:32 AM
afrah ali
afrah ali - avatar
0
RobotCrossStreet(KnowledgeEngine): @Rule(Light(color='green')) def green_light(self): print("Walk") @Rule(Light(color='red')) def red_light(self): print("Don't walk") @Rule(AS.light << Light(color=L('yellow') | L('blinking-yellow'))) def cautious(self, light): print("Be cautious because light is", light["color"]) This is rules
2nd May 2021, 3:08 AM
afrah ali
afrah ali - avatar
0
I want to build a program like a traffic lighr Sahil
2nd May 2021, 1:06 PM
afrah ali
afrah ali - avatar
0
Sahil in your programms use While loops and "True" / "False" like red = True green = False yellow = False if red: codecode
3rd May 2021, 5:01 AM
fayou
fayou - avatar
0
Ok
3rd May 2021, 5:30 AM
fayou
fayou - avatar