#๐ Zero padding doesn't work
47 messages ยท Page 1 of 1 (latest)
@winged hatch
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Click here to see this code in our pastebin.
elif AMPM.upper() == "PM" and alarm_time_hour != 12:
alarm_time_hour += 12
return f"{alarm_time_hour:02}:{alarm_time_minute:02}:00"
I have no idea why it doesn't want to zero pad the numbers
what does this output
It should output the time as a string that I then compare with the string from the now function of the datetime module
However if I input the hour as 3
for example
and ampm as pm im assume 
it should be 03:00:00
but despite formatting it to be zero padded it still returns 3:00:00 for some reason I don't quite understand
where exactly are u displaying this
displaying what
I'm not displaying the alarm time
I'm just gonna compare it with the current time later in the code
print(alarm_time) 
now im just confused
PS C:\Users\Dagger> py -c 'print(f\"{4:02}:{0:02}\")'
04:00
PS C:\Users\Dagger>
fyi u did the padding part right
i just want to know where u seeing the 3:00:00
yes that's just for logging (was trying to debug it)
In the terminal
can u show all terminal output from when u run file to when it finishes ? 
thats not all the terminal output, thats just the 2 print at the end 
AMPM = input("AM or PM?: ")
while AMPM.upper() not in ["AM", "PM"]:
AMPM = input("Please select AM or PM: ")
if AMPM.upper() == "AM":
return f"{alarm_time_hour}:{alarm_time_minute}:00"
elif AMPM.upper() == "PM" and alarm_time_hour != 12:
alarm_time_hour += 12
return f"{alarm_time_hour:02}:{alarm_time_minute:02}:00"
is just loops over the alarm time and the current time
ohhh
I just saw it
I forgot to add the zero padding to the AM if clause
this is super embarassing lol
I knew it was gonna be a stupid syntax error on my part
not even syntax error just missusing ur own code/programn
well,thanks for sticking with me and sorry for wasting your time
love how i called it out
eh it happens dw
go have ur fun
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.