- 4
I need help with python
I have a project as homework
8 Answers
+ 1
afrah ali Do you want to build a traffic light program?
+ 1
Check this out :
https://code.sololearn.com/cujyft964UJe/?ref=app
+ 1
*The program is made only for demonstration purposes
0
I have to biuld expert system, i cant do the rules
Sorry my english is not good
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
0
I want to build a program like a traffic lighr
Sahil
0
Sahil in your programms use While loops and "True" / "False" like
red = True
green = False
yellow = False
if red:
codecode
0
Ok