Problem Statement:
The problem of the earthquake in python is that we need to find the difference in energy of an earthquake of a certain magnitude. This is not a typical coding assignment but a physics assignment. We will need to find the difference between the two magnitudes of the earthquake and then find the energy with the formula: energy = 32 ^ magnitudes of the earthquake.
Code for Earthquake in Python:
first = int(input("Magnitude of first earchquake: "))
second = int(input("Magnitude of second earchquake: "))
difference = abs(second-first)
difference_in_energy = 32 ** difference
print(difference_in_energy)
Output:


Also Read:
- Hyphenate Letters in Python
- Earthquake in Python | Easy Calculation
- Striped Rectangle in Python
- Perpendicular Words in Python
- Composite Number in Python
- Greatest Among Four Numbers in Python
- Reverse the sentence in Python
- Denominations in Python
- Min and max values in an array in JavaScript
- Keyboard events in JavaScript
- Reaching Ground Floor in Python
- Number of Moves in Python
- Starks Adventure in Python
- Neutralization in Python | Assignment Expert
- Free shipping in Python
- Raj has ordered two electronic items Python | Assignment Expert
- First Place in Python
- Triples with Properties in Python
- Nested list Indexing Python
- Team Points in Python
- Two words combination in Python
- ID Card in Python
- Cipher with a key in Python | Assignment Expert
- Multiple of 5 in Python
- Sandglass Star in Python
- Multiple of 3 in Python | Assignment Expert
- Ticket selling in Cricket Stadium using Python | Assignment Expert
- Sum of List Elements in Python
- All possible subsets in Python
- Names and Nicknames in Python