Is it possible to create a function to find the perimeter of a rectangle in python. If yes how? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is it possible to create a function to find the perimeter of a rectangle in python. If yes how?

A func to find perimeter with the arguments being the length and breadth. The length and breadth is received as input from the user

5th Dec 2018, 9:51 AM
Josephine Gitanjali
Josephine Gitanjali - avatar
5 Answers
+ 3
Yes, it's quite possible. Just use the formula perimeter = 2 * (length + breadth) Try to write that into a code, and if you get stuck, share a link to your program so we can assist you further.
5th Dec 2018, 10:01 AM
Kishalaya Saha
Kishalaya Saha - avatar
+ 3
I'd like to understand the downvote (pm also ok). Is it because I made a girl cry? I mean, seriously? Last time I checked, 'protocol' on Sololearn was that we help each other with programming problems, but not just dish out the solutions (doing the homework). Kishalaya already gave a lot of help 40 minutes ago, and 'how to pass arguments' is dealt with early in the course the op has almost finished. Asking for an attempt of her own first should really not be asking for too much.
5th Dec 2018, 10:46 AM
HonFu
HonFu - avatar
+ 1
You have almost finished your Python course - you should have the knowledge to do it. Give it a try!
5th Dec 2018, 10:27 AM
HonFu
HonFu - avatar
+ 1
Okay🙄😥
5th Dec 2018, 10:28 AM
Josephine Gitanjali
Josephine Gitanjali - avatar
0
But how to do it with a function. I want to know how to pass a input from user in the func argument
5th Dec 2018, 10:14 AM
Josephine Gitanjali
Josephine Gitanjali - avatar