Earthquake in Python | Easy Calculation

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


earthquake in python
earthquake in python

Also Read:

Avatar of Ankur Gajurel

Author: Ankur Gajurel

I am Ankur from Nepal trying to learn different aspects of Information Technology and Physics. I like building websites and minor projects with Python.