DEV Community


Posted on


Ohms calculator using python

Today I written a calculator program to calculate the ohms formula by python programming language...
If you found better way to write it again please let me know directly message me or comment me.

here program starts.

print ("""ohms calculator v1.0
print("""Please enter only numbers unless it will show you an error
print("""Enter minimum 2 values
v=input(str('[Enter value of V]: '))
i=input(str('[Enter value of I]: '))
r=input(str('[Enter value of R]: '))
op=input(str("""[Enter 1 to calculate voltage]

[Enter 2 to calculate Ampere]

[Enter 3 to calculate Resistance]
if op=='1':
elif op=='2':
elif op=='3':

Oldest comments (1)

j_mplourde profile image
Jean-Michel Plourde • Edited

This is a very good start. I can see that there would be a problem if I entered a resistance of 0 then selected to calculate the voltage. There should be a try/catch or division by zero verification.

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.