first_Num = int(input("Enter First Number of an A.P Series: ")) Total_num = int(input("Enter the Total Numbers in this A.P Series: ")) diff = int(input("Enter the Common Difference: ")) # Calculation total = (Total_num * (2 * first_Num + (Total_num - 1) * diff)) / 2 tn = first_Num + (Total_num - 1) * diff # Print the Output print("\nThe Sum of Arithmetic Progression Series = " , total) print("The tn Term of Arithmetic Progression Series = " , tn)
OUTPUT:–
Enter First Number of an A.P Series: 5 Enter the Total Numbers in this A.P Series: 6 Enter the Common Difference: 15 The Sum of Arithmetic Progression Series = 255.0 The tn Term of Arithmetic Progression Series = 80