# Python program to find out the perimeter of a triangle ## Find the perimeter of a triangle in Python :

In this python programming tutorial, we will learn how to find out the perimeter of a triangle using_ user-provided_ values. The program will take the inputs from the user and print out the result.

## How to calculate the perimeter of a triangle :

The perimeter of a triangle is the sum of all of its sides. Let’s take a look at the below image :

The length of its sides is 4cm,5cm _and _4cm. So, the perimeter is 4 + 5 + 4 = 13cm. Our program will take the three sides as input from the user and print out the perimeter as output.

### Python program :

``````a = float(input("Enter the length of the first side in cm : "))
b = float(input("Enter the length of the second side in cm : "))
c = float(input("Enter the length of the third side in cm : "))

perimeter = a + b + c

print("The perimeter of the triangle is {} ".format(perimeter))``````

### Sample Output :

``````Enter the length of the first side in cm : 5
Enter the length of the second side in cm : 4
Enter the length of the third side in cm : 4
The perimeter of the triangle is 13.0

Enter the length of the first side in cm : 40
Enter the length of the second side in cm : 90
Enter the length of the third side in cm : 100
The perimeter of the triangle is 230.0

Enter the length of the first side in cm : 3
Enter the length of the second side in cm : 3
Enter the length of the third side in cm : 3
The perimeter of the triangle is 9.0``````
{"ft_lang_label":"__label__en","ft_lang_prob":0.81237084,"math_prob":0.9953482,"size":1411,"snap":"2021-43-2021-49","text_gpt3_token_len":365,"char_repetition_ratio":0.24235962,"word_repetition_ratio":0.3702422,"special_character_ratio":0.27852586,"punctuation_ratio":0.09771987,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9981939,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-12-07T03:15:03Z\",\"WARC-Record-ID\":\"<urn:uuid:b673da1f-6b2c-4de2-ae3e-e2a2fe1d42f6>\",\"Content-Length\":\"88129\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a3f7dcc7-d279-45b0-af87-99c483586dcf>\",\"WARC-Concurrent-To\":\"<urn:uuid:38b7c4b0-09dc-4ff9-b3ef-f9258cc67214>\",\"WARC-IP-Address\":\"3.234.104.255\",\"WARC-Target-URI\":\"https://www.codevscolor.com/python-find-perimeter-triangle\",\"WARC-Payload-Digest\":\"sha1:QBBZYYIAT2SGZZ46V6N5WPCZURMI74AJ\",\"WARC-Block-Digest\":\"sha1:FKFGCRESZ77NNMGH6VORWTBUZK5QEI7N\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964363332.1_warc_CC-MAIN-20211207014802-20211207044802-00261.warc.gz\"}"}