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 floating-point value is acceptable. Using this data iterate from 0 to the entered voltage in 0.1v 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
(V)(ohms)(A)(W)
xxx xxxx x.xx x.xx
....
....
....
....
**********************************************
Below this nice output print the lists to the screen
Submit both your handwritten problem-solving 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 = float(input("Enter the resistance (ohms): "))
max_voltage = float(input("Enter the maximum voltage (V): "))
Initialize lists for voltage, current, and power
voltage_list =[]
current_list =[]
power_list =[]
Print header
print("
****************************************************)
print(" CIRCUIT AMPERAGE AND POWER")
print("
Voltage Resistance Current Power")
print("(V)(ohms)
(A)
(W)")
Iterate from 0 to max_voltage in increments of 0.1
for voltage in range(int(max_voltage *10)+1):
voltage_value = voltage /10.0 # Convert to float (0.1 increments)
Calculate current and power
current = voltage_value / resistance
power = voltage_value * current
Append values to lists
voltage_list.append(voltage_value)
current_list.append(current)
power_list.append(power)
Print formatted output
print(f"{voltage_value:5.1f}{resistance:8.2f}{current:7.2f}{power:7.2f}")
Print the lists below the output
print("
***************************************************)
print("Voltage List:", voltage_list)
print("Current List:", current_list)
print("Power List:", power_list)
Run the main function
if name == "main":
main()
Write a Python script that will read the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!