Python Functions
1) Write a function that calculates the volume of a sphere with radius r for only values > 0, return 0 otherwise . V=4/3 π r^3
2) Write a function that finds you weight in stones using the formula. mstone = mkgx2.2/14
3) Write a function that takes some monetary amount from the user in dollars, and then display exact changes for this amount using the minimum number of coins. For example, $0.97 shows 3 quarters, 2 dimes, and 2 pennies.
Output:
change_it(97)
The change for 97 cents is:
3 quarters
2 dimes
2 pennies
Write an function to calculate both Ohm’s Law and Power transferred. The function takes i and r as inputs and prints the results (see output below). Calculate only if both i and r are > 0.
FORMULA
i is current, v is voltage, r is resistance, p is power
p = i * v # power = current * volatage
v = i * r # voltage = current * resistance
def ohms_law(i, r):
'''
i is current
r is resistance
'''
# check if both i and r are greater than 0
# calculate v and p
# PRINT v and p
omhs_law(5, 5)
v = 25 p = 125
omhs_law(-5, -5)
06 years ago 45
Answer(1)
Purchase the answer to view it
- 1605985529607_image.png
- 1605985544484_image.png
- 1605985551745_image.png
- 1605985557655_image.png
- 1605985563431_image.png
- 1605985537048_image.png
- Soloution.zip
- 1605985518662_image.png
other Questions(10)
- Exceptional Geek Only!!!! Unit 1 Individual Project
- Annotated Bibliography on Criminal Justice Topics*****Already A++ Rated Tutorial Use as Guide Paper*****
- Economic Systems*****Already A++ Rated Tutorial Use as Guide Paper*****
- Methodological Issues Article Review
- Please respond to the following: Watch the short video on basic corporate structure and business entities. The video helps explain some of the legal nuances of a corporation and compares the corporation to other types of business entities discussed in the
- ASAP
- Unit VIII
- assignment II
- needs to be done by 8;00 PM EASTERN TIME CLASS DISCUSSION
- 350 words