I have a dice program I'm working on in python and when I try and do an "else" statement it doesn't work.
Here's my code:
'''
Made by Thou
http://v.ht/Thou
'''
import os
import time
from random import *
from colorama import *
os.system('cls') # Clears the screen
print(Fore.RED + 'Made by Thou')
print(Fore.RED + '@Th0u__')
print() # Blank line
print(Fore.WHITE + 'What dice would you like to roll?')
print("D4, D6, D10, D12, D20")
D4 = randint(1, 4) # Normal definition
D6 = randint(1, 6) # Normal definition
D10 = randint(1, 10) # Normal definition
D12 = randint(1, 12) # Normal definition
D20 = randint(1, 20) # Normal definition
age = D4 # Normal definition
diceI = input(":") # The thing that shows ':'
# Messy code woo
if diceI == "D4" or "d4":
time.sleep(.1)
os.system('cls')
print(randint(1, 4))
time.sleep(.2)
os.system('cls')
print(randint(1, 4))
time.sleep(.2)
os.system('cls')
print(randint(1, 4))
time.sleep(.3)
os.system('cls')
print(randint(1, 4))
time.sleep(.4)
os.system('cls')
print(randint(1, 4))
time.sleep(.4)
os.system('cls')
print(randint(1, 4))
time.sleep(.5)
os.system('cls')
print(randint(1, 4))
time.sleep(.6)
os.system('cls')
print(randint(1, 4))
time.sleep(.6)
os.system('cls')
print(randint(1, 4))
time.sleep(.7)
os.system('cls')
print(randint(1, 4))
time.sleep(.8)
os.system('cls')
print(randint(1, 4))
time.sleep(.8)
os.system('cls')
print(randint(1, 4))
elif diceI == "D6" or "d6":
time.sleep(.1)
os.system('cls')
print(randint(1, 6))
time.sleep(.2)
os.system('cls')
print(randint(1, 6))
time.sleep(.2)
os.system('cls')
print(randint(1, 6))
time.sleep(.3)
os.system('cls')
print(randint(1, 6))
time.sleep(.4)
os.system('cls')
print(randint(1, 6))
time.sleep(.4)
os.system('cls')
print(randint(1, 6))
time.sleep(.5)
os.system('cls')
print(randint(1, 6))
time.sleep(.6)
os.system('cls')
print(randint(1, 6))
time.sleep(.6)
os.system('cls')
print(randint(1, 6))
time.sleep(.7)
os.system('cls')
print(randint(1, 6))
time.sleep(.8)
os.system('cls')
print(randint(1, 6))
time.sleep(.8)
os.system('cls')
print(randint(1, 6))
elif diceI == "D10" or "d10":
time.sleep(.1)
os.system('cls')
print(randint(1, 10))
time.sleep(.2)
os.system('cls')
print(randint(1, 10))
time.sleep(.2)
os.system('cls')
print(randint(1, 10))
time.sleep(.3)
os.system('cls')
print(randint(1, 10))
time.sleep(.4)
os.system('cls')
print(randint(1, 10))
time.sleep(.4)
os.system('cls')
print(randint(1, 10))
time.sleep(.5)
os.system('cls')
print(randint(1, 10))
time.sleep(.6)
os.system('cls')
print(randint(1, 10))
time.sleep(.6)
os.system('cls')
print(randint(1, 10))
time.sleep(.7)
os.system('cls')
print(randint(1, 10))
time.sleep(.8)
os.system('cls')
print(randint(1, 10))
time.sleep(.8)
os.system('cls')
print(randint(1, 10))
elif diceI == "D12" or "d12":
time.sleep(.1)
os.system('cls')
print(randint(1, 12))
time.sleep(.2)
os.system('cls')
print(randint(1, 12))
time.sleep(.2)
os.system('cls')
print(randint(1, 12))
time.sleep(.3)
os.system('cls')
print(randint(1, 12))
time.sleep(.4)
os.system('cls')
print(randint(1, 12))
time.sleep(.4)
os.system('cls')
print(randint(1, 12))
time.sleep(.5)
os.system('cls')
print(randint(1, 12))
time.sleep(.6)
os.system('cls')
print(randint(1, 12))
time.sleep(.6)
os.system('cls')
print(randint(1, 12))
time.sleep(.7)
os.system('cls')
print(randint(1, 12))
time.sleep(.8)
os.system('cls')
print(randint(1, 12))
time.sleep(.8)
os.system('cls')
print(randint(1, 12))
elif diceI == "D20" or "d20":
time.sleep(.1)
os.system('cls')
print(randint(1, 20))
time.sleep(.2)
os.system('cls')
print(randint(1, 20))
time.sleep(.2)
os.system('cls')
print(randint(1, 20))
time.sleep(.3)
os.system('cls')
print(randint(1, 20))
time.sleep(.4)
os.system('cls')
print(randint(1, 20))
time.sleep(.4)
os.system('cls')
print(randint(1, 20))
time.sleep(.5)
os.system('cls')
print(randint(1, 20))
time.sleep(.6)
os.system('cls')
print(randint(1, 20))
time.sleep(.6)
os.system('cls')
print(randint(1, 20))
time.sleep(.7)
os.system('cls')
print(randint(1, 20))
time.sleep(.8)
os.system('cls')
print(randint(1, 20))
time.sleep(.8)
os.system('cls')
print(randint(1, 20))
else:
print(Fore.RED + 'That isnt an option!")
I think the problem is the code is near the end when this happens:
else:
print(Fore.RED + 'That isnt an option!")
I have no idea what's going on. Whenever I try to type something that wasn't if the "if"s or "elif"s it just uses the D4 dice. Please help!