Ask Your Question
4

Is it possible to convert minutes to hours without using two times the variable?

asked 2021-12-23 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-02-17 10:00:00 +0000

david gravatar image

Yes, it is possible to convert minutes to hours without using two times the variable. Here's one way to do it:

Let's say you have a variable minutes that you want to convert to hours. Instead of using minutes/60 to get the number of hours, you can use (1.0/60)*minutes.

For example:

minutes = 120
hours = (1.0/60)*minutes
print(hours) # Output: 2.0

This way, you only use the variable minutes once to get the number of hours.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-12-23 11:00:00 +0000

Seen: 11 times

Last updated: Feb 17 '22