Part of the series

Several example codes

~1 min read • Updated Sep 29, 2025

Program Overview

This Python program calculates the total (equivalent) resistance of three resistors—RF, RX, and R1—connected in parallel.
The formula used for parallel resistance is:
1 / RT = 1 / RF + 1 / RX + 1 / R1
Where RT is the total resistance.


Python Code:


# Get resistor values from user
RF = float(input("Enter resistance RF (ohms): "))
RX = float(input("Enter resistance RX (ohms): "))
R1 = float(input("Enter resistance R1 (ohms): "))

# Calculate total resistance in parallel
inverse_total = (1 / RF) + (1 / RX) + (1 / R1)
RT = 1 / inverse_total

# Display result
print("\n--- Result ---")
print(f"Total resistance (RT) = {RT:.2f} ohms")

Sample Output:


Enter resistance RF (ohms): 100  
Enter resistance RX (ohms): 200  
Enter resistance R1 (ohms): 300  

--- Result ---  
Total resistance (RT) = 54.55 ohms

Explanation:

- The user inputs the resistance values for RF, RX, and R1
- The program calculates the reciprocal of each resistance and sums them
- The total resistance is the reciprocal of that sum
- The result is displayed with two decimal places for clarity


Written & researched by Dr. Shahin Siami