- 7

# how many seconds are in one month

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

17 Answers

+ 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++

+ 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)

+ 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 ;)

+ 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)

+ 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)

+ 3

Hil La First show your attempts.

+ 3

use what I just said ;)

+ 2

thats not python tho

+ 2

i should not have included (#include stdio.h ) help me out

+ 1

thanks guys...but still am told ther is a bug in using Mohammad Sadra Shakouri way..

+ 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.

+ 1

It's depend on which month you are choosing

0

"line 1
invalid syntax"

0

and what's your line 1? (provide your full code, it would help)

- 1

month == 30 or 31 days,
day == 24 hours
hour == 60 minutes
minutes = 60 seconds
print('30 * 24 * 60 * 60 ')

- 1

One month, 31 days, 744 hours, 44640 minutes, 2678400 seconds

- 5

#include<stdio.h>
print('how Many senconds are in a month?')
print ('24 * 60 * 60 * 30')