🎉 Félicitations ! 🎉
Tu as brillamment résolu la tâche ! C était difficile, mais tu as trouvé la bonne solution. Tu es encore plus proche de maîtriser la programmation ! Continue ainsi.
ProgerLib Python pour tous
une ligne contenant une date au format & nbsp;
Une ligne contenant la même date, mais au format & nbsp;
09-12-1995
1995/12/09
# Считываем входную строку с датой
date_string = input()
# Разбиваем строку по символу '-' на три части: день, месяц, год.
# В результате получается список из трех строковых элементов.
# Например, для "09-12-1995" получится список ['09', '12', '1995']
parts = date_string.split('-')
# Извлекаем каждую часть в отдельную переменную для наглядности
day = parts[0] # '09'
month = parts[1] # '12'
year = parts[2] # '1995'
# Соединяем (конкатенируем) части в новом порядке,
# используя в качестве разделителя символ '/'
new_date_format = year + '/' + month + '/' + day
# Выводим полученный результат на экран
print(new_date_format)
🎉 Félicitations ! 🎉
Tu as brillamment résolu la tâche ! C était difficile, mais tu as trouvé la bonne solution. Tu es encore plus proche de maîtriser la programmation ! Continue ainsi.
AD
Publicité
Exécution de votre code...