FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Basic-Programs-Python/Programs/seconds_format.py at master · Akshu-on-github/Basic-Programs-Python · GitHub
This repository was archived by the owner on Jan 30, 2023. It is now read-only.
Akshu-on-github
/
Basic-Programs-Python
Public archive
Notifications
You must be signed in to change notification settings
Fork
23
Star
13
Code
Issues
0
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Basic-Programs-Python
/
Programs
/
seconds_format.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (14 loc) · 440 Bytes
Breadcrumbs
Basic-Programs-Python
/
Programs
/
seconds_format.py
Copy path
File metadata and controls
17 lines (14 loc) · 440 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'''
Question - Write a program that reads a number of seconds and prints it in form : mins and seconds .
Example - 200 seconds are printed as 3 mins and 20 seconds.
'''
# Solution-
totalsec
=
int
(
input
(
"Enter the number of seconds"
))
seconds
=
totalsec
%
60
minutes
=
totalsec
//
60
if
minutes
>=
60
:
hours
=
minutes
//
60
minutes
=
minutes
%
60
print
(
"hours"
,
hours
,
"minutes"
,
minutes
,
"seconds"
,
seconds
)
else
:
print
(
"minutes"
,
minutes
,
"seconds"
,
seconds
)
Back
|
FazBrowse Home
|
New Git URL