Question: Write a Python script that will read the resistance from the user and the maximum voltage, any floating - point value is acceptable. Using this
Write a Python script that will read the resistance from the user and the maximum voltage, any floatingpoint value is acceptable. Using this data iterate from to the entered voltage in v increments. Compute the current drawn from the voltage source and the power dissipated by the resistor. Write the voltage, current, and power to a list. Output the values in the format shown below and print the lists at the end of the script.
OUTPUT FORMAT:
CIRCUIT AMPERAGE AND POWER
Voltage Resistance Current Power
VohmsAW
xxx xxxx xxx xxx
Below this nice output print the lists to the screen
Submit both your handwritten problemsolving process and your Python source code. Need assistance not sure what handwritten problem I need to submit Please see attached picture for additional info
Also review Code and I think it works but if there is anything that needs to be corrected or improved please help Thank you.
def main:
Get user input for resistance and maximum voltage
resistance floatinputEnter the resistance ohms:
maxvoltage floatinputEnter the maximum voltage V:
Initialize lists for voltage, current, and power
voltagelist
currentlist
powerlist
Print header
print
print CIRCUIT AMPERAGE AND POWER"
print
Voltage Resistance Current Power"
printVohms
A
W
Iterate from to maxvoltage in increments of
for voltage in rangeintmaxvoltage :
voltagevalue voltage # Convert to float increments
Calculate current and power
current voltagevalue resistance
power voltagevalue current
Append values to lists
voltagelist.appendvoltagevalue
currentlist.appendcurrent
powerlist.appendpower
Print formatted output
printfvoltagevalue:fresistance:fcurrent:fpower:f
Print the lists below the output
print
printVoltage List:", voltagelist
printCurrent List:", currentlist
printPower List:", powerlist
Run the main function
if name "main":
main
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
