Create a program that reads a duration from the user as a number of days, hours, minutes, and seconds. Compute and display the total number of seconds represented by this duration.
a=int(input("Days: ")) b=int(input("Hours: ")) c=int(input("Minutes: ")) d=int(input("Seconds: ")) e=d+c*60+b*3600+a*24*3600 print("\nDays= " + str(a)) print("Hours= " + str(b)) print("Minutes= " + str(c)) print("Seconds= " + str(d)) print("Total= " + str(e))
INPUT_1:
Days: 1
Hours: 0
Minutes: 0
Seconds: 0
OUTPUT:
Days= 1
Hours= 0
Minutes= 0
Seconds= 0
Total= 86400
INPUT_2:
Days: 2
Hours: 12
Minutes: 35
Seconds: 25
OUTPUT:
Days= 2
Hours= 12
Minutes= 35
Seconds= 25
ILLUSTRATION
![](http://www.fcukthecode.com/wp-content/uploads/2022/02/Screenshot-from-2022-02-06-18-35-34.png)
Morae Q!
- Program to get dictionary items, use update module and items module.
- Regular expression allowing certain set of characters.
- Compute the Sum of Cosine Series.
- Find the Sum of Sine Series.
- Remove the Vowels from the string.
- Find All Non-Overlapping strings/characters using regular expressions .
- Check whether the given string is Panagram or not.
- Replacing strings using Regular Expression Regex.
- Check whether the given number is Strong number or not.
- Find the numbers divisible by a input numbers within the given range.
- Change the behaviour of the Regular Expression using flags.
- Find the exponentiation of a number.
- Find all prime numbers in a range using Sieve of Eratosthenes.
- Convert decimal equivalent into binary, hexadecimal and octal.
- Compute the area of a farmers field in feet.
- Compute time from number of days/hours to seconds.
- Precompiled patterns using Regular Expressions .
- Compute the price of the cake on the nth day.
- Compute the number of possible non-increasing arrays.
- Find the type of spinach using the calorie value.