month =
{"January" : "01",
"February" : "02" ,
"March" : "03",
"April" : "04",
"May" : "05",
"June" : "06",
"July" : "07",
"August" : "08",
"September" : "09",
"October" : "10",
"November" : "11",
"December" : "12"
}
while True:
try:
date = input("Date: ")
if date[0].isdecimal():
x, y, z = date.split("/")
while y < 31:
print(f"{z}-{x:0>2}-{y:0>2}")
elif date[0].isalpha():
x, y, z = date.split(" ")
y = y.replace(",", "")
x = x.title()
while y < 31:
if x in month:
print(f"{z}-{month.value(x)}-{y}")
except:
pass
This is my code and I can't stop it, even I use Ctrl+C. What can I try next?
This is the ps3 in Cs50P.
Ctrl-Cthrows aKeyboradInteruptErrorwhich you promptly ignore...exceptbug ... see the other comments / answers), but will depend on what OS you are running. (And that's not a StackOverflow question. It is a basic "how do I use my computer" question.)