시작하기무료로 시작하기

시간이 어려운 이유, 길고 짧은 이야기

W20529가 이용한 291번의 이동 중, 가장 긴 이동은 얼마나 오래 걸렸나요? 가장 짧은 이동은 얼마나 짧았나요? 수상해 보이는 값이 있나요?

이전과 마찬가지로, 데이터는 onebike_durations로 불러와 두었습니다.

이 연습은 강의의 일부입니다

Python에서 날짜와 시간 다루기

강의 보기

연습 안내

  • onebike_durations에서 shortest_trip을 계산하세요.
  • onebike_durations에서 longest_trip을 계산하세요.
  • 결과를 출력하되, shortest_triplongest_trip을 문자열로 변환하여 출력하세요.

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

# Calculate shortest and longest trips
shortest_trip = ____(____)
longest_trip = ____(____)

# Print out the results
print("The shortest trip was " + ____ + " seconds")
print("The longest trip was " + ____ + " seconds")
코드 편집 및 실행