Question
To Find the number of handshakes for given persons .
Sample TestCaseExpected Output
Enter number of persons : 10 Total number of Handshake : 45
Answer
num=int(input("Enter number of Persons : "))
total=0
total=num*(num-1)/2
print("Total number of Handshakes : ",int(total))

No comments:
Post a Comment