Created
February 2, 2018 18:36
-
-
Save mridubhatnagar/b6d00b84c48b48057f1cacac54f1329b to your computer and use it in GitHub Desktop.
Quora Doubt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
option1=input("Choose the First Colour\n" | |
"0. Black\n" | |
"1. Brown\n" | |
"2. Red \n") | |
option2= input("Choose the Second Colour\n" | |
"0. Black\n" | |
"1. Brown\n" | |
"2. Red\n") | |
option3=input(" Choose the Third color\n " | |
"0. Black\n" | |
"2. Brown\n" | |
"3. Red\n") | |
Black, blue, red = 5, 4,7 | |
if option1 =='0': | |
print(option2) | |
a=[] | |
a.append(Black) | |
elif option1=='1': | |
print(option2) | |
else: | |
print(option2) | |
if option2=='0': | |
print(option3) | |
elif option2=='1': | |
print(option3) | |
a.append(blue) | |
else: | |
print(option3) | |
if option3=='3': | |
a.append(red) | |
s=''.join([str(element) for element in a])+"ohms" | |
print(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Made changes in line 35, 36 only. Based on your question and reference link https://stackoverflow.com/questions/48502380/how-do-i-add-a-string-say-ohms-to-the-list-after-the-value-in-the-list-is-printe