How do I take input values in minutes and seconds? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I take input values in minutes and seconds?

Hi guys I wanna design a software in python which takes input in minutes and seconds and convert them into pure minutes. For example, it takes input 1:30 and then converts it into 1.5 Sorry I don't have any post of code, I wanna take inputs from scratch

14th Jul 2020, 10:37 AM
Haroon Asif
Haroon Asif - avatar
5 Answers
+ 3
basically you can use split() to split your input then convert them to int then do min + second / 60 and you have your answer in float form here is an example https://code.sololearn.com/cNcYlrmfkoiT/?ref=app
14th Jul 2020, 12:23 PM
Arda Atıcı
Arda Atıcı - avatar
+ 1
Haroon Asif I just posted a solution...
14th Jul 2020, 12:33 PM
Arda Atıcı
Arda Atıcı - avatar
+ 1
Thank you so much for helping me out!
14th Jul 2020, 1:08 PM
Haroon Asif
Haroon Asif - avatar
0
Where are you stuck?
14th Jul 2020, 10:37 AM
Théophile
Théophile - avatar
- 1
Haroon Asif Don't complicate things for yourself. If 1:30 is 1.5, how do you convert 1:31 to pure minutes? That should be about 1.51 something. what do you want to use this converted number for?
14th Jul 2020, 12:32 PM
Tomiwa Joseph
Tomiwa Joseph - avatar