Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Time Calculation in Python | Знайомство з числами в Python
Типи даних у Python

book
Challenge: Time Calculation in Python

Завдання

Swipe to start coding

Imagine you are a bookkeeper, and you need to process 10 financial transactions. You've noticed that each transaction takes an average of 7 minutes, but you only have 60 minutes available.

  1. Calculate how many transactions you couldn't complete and assign the result to the variable remaining_tasks.
  2. Calculate how many minutes would be needed to complete all 10 transactions if each takes 7 minutes, and assign the result to the variable required_time.

Рішення

# Number of completed transactions
completed = 60 // 7
# Number of remaining minutes
minutes = 60 % 7
# Set the number of remaining transactions
remaining_tasks = 10 - completed
# Set the total time needed to complete all transactions
required_time = 10 * 7

# Print the results
print("The number of remaining transactions is", remaining_tasks)
print("The number of minutes needed to complete all transactions is", required_time)
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 6
single

single

# Number of completed transactions
completed = 60 // 7
# Number of remaining minutes
minutes = 60 % 7
# Set the number of remaining transactions
remaining_tasks = ___
# Set the total time needed to complete all transactions
required_time = ___

# Print the results
print("The number of remaining transactions is", ___)
print("The number of minutes needed to complete all transactions is", ___)

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

some-alt