- 7

how many seconds are in one month

am woking on my first python text, can you help!

1st Mar 2021, 7:48 AM
Hil La
Hil La - avatar
17 Antworten
+ 8
month == 30 or 31 days, 28 or 29 if february day == 24 hours hour == 60 minutes minutes = 60 seconds so answer 30*24*60*60 print() is used in python, but #include is used in C/C++
1st Mar 2021, 8:11 AM
visph
visph - avatar
+ 7
#each month is 30 days #each day is 24 hours #each hour is 60 minutes #each minute is 60 seconds print(30 * 24 * 60 * 60)
1st Mar 2021, 8:08 AM
Sadra Shakouri
Sadra Shakouri - avatar
+ 4
maybe you are asking to produce output based on number of months, so you need to print(numberOfMonths*30*24*60*60) where numberOfMonth should be replaced with the variable name containing the... number of months ;)
1st Mar 2021, 8:24 AM
visph
visph - avatar
+ 4
you cannot write such things.... == equality operator = assignement operator so, either: months = int(input()) days_per_month = 30 hours_per_day = 24 minutes_per_hour = 60 seconds_per_minute = 60 print(months*days_per_month*hours_per_day*mnutes_per_hour*seconds_per_minute) or: months = int(input()) print(months*30*24*60*60)
1st Mar 2021, 8:46 AM
visph
visph - avatar
+ 4
seconds = 60 minutes = 60 hours = 24 # cd be input days = 30 # or 31 or 28 or 29 😉 cd be input month_seconds = seconds * minutes * hours * days print(month_seconds)
1st Mar 2021, 11:52 AM
iTech
iTech - avatar
+ 3
Hil La First show your attempts.
1st Mar 2021, 7:53 AM
A͢J
A͢J - avatar
+ 3
use what I just said ;)
1st Mar 2021, 8:30 AM
visph
visph - avatar
+ 2
thats not python tho
1st Mar 2021, 8:04 AM
Sadra Shakouri
Sadra Shakouri - avatar
+ 2
i should not have included (#include stdio.h ) help me out
1st Mar 2021, 8:06 AM
Hil La
Hil La - avatar
+ 1
thanks guys...but still am told ther is a bug in using Mohammad Sadra Shakouri way..
1st Mar 2021, 8:20 AM
Hil La
Hil La - avatar
+ 1
Here is the original question. Remember, there are 24 hours in a day, 60 minutes in an hour, and 60 seconds in a minute. Use the print() statement to output the result.
1st Mar 2021, 8:29 AM
Hil La
Hil La - avatar
+ 1
It's depend on which month you are choosing
2nd Mar 2021, 12:16 PM
Little Coder
Little Coder - avatar
0
"line 1 invalid syntax"
1st Mar 2021, 8:36 AM
Hil La
Hil La - avatar
0
and what's your line 1? (provide your full code, it would help)
1st Mar 2021, 8:37 AM
visph
visph - avatar
- 1
month == 30 or 31 days, day == 24 hours hour == 60 minutes minutes = 60 seconds print('30 * 24 * 60 * 60 ')
1st Mar 2021, 8:39 AM
Hil La
Hil La - avatar
- 1
One month, 31 days, 744 hours, 44640 minutes, 2678400 seconds
25th Apr 2021, 2:27 PM
Aravind narayan
Aravind narayan - avatar
- 5
#include<stdio.h> print('how Many senconds are in a month?') print ('24 * 60 * 60 * 30')
1st Mar 2021, 8:00 AM
Hil La
Hil La - avatar