Python program to take input of three numbers and calculate sum of only non duplicate numbers

preview_player
Показать описание
Program to take input of three numbers and calculate two sums as per this:-
(a) sum1 as the sum of all inputted numbers.
(b) sum2 as the sum of non duplicate numbers. if there are duplicate numbers in the input, ignores them.
Рекомендации по теме
Комментарии
Автор

Nice and informative video Sir 💻 Thanks sir 🙏

Youtube_YT..
Автор

Alternative 2

sum1 = sum2 = 0
num1 =int(input("Enter number 1: "))
num2 =Int(1nput(" Enter number 2:" ))
num3 =Int(input(" Enter number 3: " ))
sum1 = num1 + num2 + num3
if num1==num2:
if num3 != num1:
sum2 += num3

else:

if num1==num3:
sum2 += num2

else:

if num2== num3:
sum2 += num1

else:
sum2 += num1 + num2 + num3
print("Numbers are", num1, num2, num3)
print("Sum of three given numbers is", sum1)
print("Sum of non-duplicate numbers is", sum2)

AnushkaHaralLive-aa
Автор

Sir but in second case I want to only add 6 number , , no 5 number allow as per book, !!!*in book answer is 6 for second case*
Same query in case 3

AnushkaHaralLive-aa
Автор

Sir you take any classes for computer online for doubt solving?
In computer class 11 and 12 i have so much doubt
Sir can get personal guidance from you
As after 10 days you are uploading videos it is too late for me
Can I get your number?

AnushkaHaralLive-aa