Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- resistor_one = float(input("Enter the resistance of the first resistor: "))
- resistor_two = float(input("Enter the resistance of the second resistor: "))
- circuit_type = input("Enter the circuit type: ")
- if circuit_type.upper() == "SERIES":
- resistance = resistor_one + resistor_two
- print(f"The total resistance is {resistance} ohms.")
- elif circuit_type.upper() == "PARALLEL":
- resistance = resistor_one * resistor_two / (resistor_one + resistor_two)
- print(f"The total resistance is {resistance} ohms.")
- else:
- print("Error: The circuit type doesn't exist.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement