Code not working

+2 votes
asked May 3 by QuiiKy _ (420 points)
I am experimenting with colored text on python and can't find out why this isn't working:

import time
color = []

print("\x1b[1;32;40m Bright Green\n")
print("\x1b[1;31;40m Red\n")
print("\x1b[1;33;40m Yellow\n")
print("\x1b[1;34;40m Blue\n")
print("\x1b[1;35;40m Purple\n")
print("\x1b[1;36;40m Cyan\n")
print("\x1b[1;37;40m White\n")
print("\x1b[1;30;40m Black\n")
print('\x1b[0;37;40m Please enter disired text color\n')
if input() == 'bright green':
        print("\x1b[0;32;40m Great! You chose green!")
        color = ["Bright Green"]
        time.sleep(2)
        if input('''You can see your current color by typing "color"
        ''') == 'color':
                print(color)
elif input() == 'red':
        print("\x1b[0;31;40m Great! You chose red!")
        color = ["Red"]
        time.sleep(2)
        if input('''You can see your current color by typing "color"
        ''') == 'color':
                print(color)
elif input() == 'yellow':
        print("\x1b[0;33;40m Great! You chose yellow!")
        color = ["Yellow"]
        time.sleep(2)
        if input('''You can see your current color by typing "color"
        ''') == 'color':
                print(color)
elif input() == 'blue':
        print("\x1b[0;34;40m Great! You chose blue!")
        color = ["Blue"]
        time.sleep(2)
        if input('''You can see your current color by typing "color"
        ''') == 'color':
                print(color)  
elif input() == 'purple':
        print("\x1b[0;35;40m Great! You chose purple!")
        color = ["Purple"]
        time.sleep(2)
        if input('''You can see your current color by typing "color"
        ''') == 'color':
                print(color)
elif input() == 'cyan':
        print("\x1b[0;36;40m Great! You chose cyan!")
        color = ["Cyan"]
        time.sleep(2)
        if input('''You can see your current color by typing "color"
        ''') == 'color':
                print(color)
elif input() == 'black':
        print("\x1b[0;30;40m Great! You chose black!")
        color = ["Black"]
        time.sleep(2)
        if input('''You can see your current color by typing "color"
        ''') == 'color':
                print(color)
elif input() == 'white':
        print("\x1b[0;37;40m Great! You chose white!\n")
        color = ["White"]
        time.sleep(2)
        if input('''You can see your current color by typing "color"
        ''') == 'color':
                print(color)
else:
        print("Type lowercase or restart program.")

1 Answer

0 votes
answered May 5 by Birchi (150 points)
dude u dont have an input
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...