0

What's the fault in my code 🙁🙁

Just a one case doesn't work 🙁 h=input() months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] L=h.split(' ') if L[0] not in months: N=h[3:6]+h[:3]+h[6:] print (N) else: K=months.index(L[0])+1 Y=L[1] N=Y[:-1]+'/'+str(K)+'/'+L[2] print (N)

20th Sep 2020, 3:35 PM
إسلام دخيلي
إسلام دخيلي - avatar
6 Answers
+ 3
What do you want to do with this?
20th Sep 2020, 4:19 PM
Muhammadamin
Muhammadamin - avatar
+ 3
Here you should get whole Y. So not Y[:-1] but Y[0:] N=Y[0:]+'/'+str(K)+'/'+L[2]
22nd Sep 2020, 5:29 PM
Muhammadamin
Muhammadamin - avatar
22nd Sep 2020, 6:37 PM
Muhammadamin
Muhammadamin - avatar
+ 1
Convert US date to EU date
22nd Sep 2020, 5:02 PM
إسلام دخيلي
إسلام دخيلي - avatar
+ 1
إسلام دخيلي Try this if you input September 22 2020 It prints 22/9/2020
22nd Sep 2020, 6:38 PM
Muhammadamin
Muhammadamin - avatar
0
No it's y[:-1] cz we have in L a num+,
22nd Sep 2020, 6:29 PM
إسلام دخيلي
إسلام دخيلي - avatar