Convert EUR date to US date | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Convert EUR date to US date

Why is this code wrong (in 2 cases) in code coach section? import calendar inp=input() if inp.find('/')==-1: inp=inp.replace(',','') inp=inp.split() for i in range(13): if calendar.month_name[i]==inp[0]: m=str(i) d=inp[1] y=inp[2] else: s=inp.find('/') ss=inp.rfind('/') m=inp[s+1:ss] d=inp[:s] y=inp[-(len(inp)-ss-1):] #print(len(inp)) #print(s) #print(ss) #print(m) #print(d) #print(y) print(m+'/'+d+'/'+y)

14th Mar 2020, 10:02 AM
Paweł Malewicz
Paweł Malewicz - avatar
2 Answers
+ 1
You Program output for farmat Month dd, yyyy is giving output wrong.. Its giving like MM dd yyyy But it should like dd Mm yyyy according to description Input: November 1, 1988 Output: 1/11/1988
14th Mar 2020, 12:25 PM
Jayakrishna 🇮🇳
0
Yeah. You're right. I did conversion from US date to... US date ;) 2 small changes and it works. Thank you :)
14th Mar 2020, 12:39 PM
Paweł Malewicz
Paweł Malewicz - avatar