-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathimagetodecription.py
45 lines (36 loc) · 1.33 KB
/
imagetodecription.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
def generate_switch_sentence(image1, image2, image3):
results = ["This vending machine accepts: "]
if image1 == "CreditCheck.png":
results.append("card")
elif image1 == "CreditX.png":
results.append("")
if image2 == "CashCheck.png":
if image1 == "CreditX.png":
results.append("cash")
else:
results.append(", cash")
elif image2 == "Cashx.png":
results.append("")
if image3 == "PhoneCheck.png":
if image1 == "CreditX.png" and image2 == "CashX.png":
results.append("wireless payments")
else:
results.append(", wireless payments")
elif image3 == "PhoneX.png":
results.append("")
return "".join(results)
def main():
'''
First image expects Credit image.
Second image expects Cash image.
Third image expects phone image.
'''
# Prompt the user to enter the state of each switch
switch1_input = input("First image name: ").strip()
switch2_input = input("second image name: ").strip()
switch3_input = input("third image name: ").strip()
# Generate and print the output sentence
output_sentence = generate_switch_sentence(switch1_input, switch2_input, switch3_input)
print(output_sentence)
if __name__ == "__main__":
main()