+ 1

Convert date challenge What is wrong?

This is my try ,can not understand error type .https://code.sololearn.com/c47LsqN7n1Z6/?ref=app

10th Sep 2020, 7:21 PM
HBhZ_C
HBhZ_C - avatar
4 Antworten
+ 1
There are two cases in input ..did u consider those
11th Sep 2020, 11:27 AM
Suhail KM
+ 1
from datetime import datetime s=input() try: print(datetime.strptime(s, "%m/%d/%Y").strftime("%-d/%-m/%Y")) except: print(datetime.strptime(s, "%B %d, %Y").strftime("%-d/%-m/%Y"))
10th Sep 2020, 7:29 PM
Suhail KM
+ 1
suael Thank you, it works fine in a desktop ide but here only case 1 and 3 are correct.I try it here and in python ide .
11th Sep 2020, 11:13 AM
HBhZ_C
HBhZ_C - avatar
+ 1
[Solved]Thanks , it was a bad formatted code error .but still not working in test cases .
11th Sep 2020, 11:48 AM
HBhZ_C
HBhZ_C - avatar