Maximum Number of Handshakes - Learn Engineering

All the news and updates relevant to Engineering. You can also Write a post here

Breaking

Friday, June 19, 2020

Maximum Number of Handshakes

python-mini

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