0

What is wrong in this code? plz help

https://www.sololearn.com/coach/150?ref=app

8th Jan 2021, 4:18 AM
Prathmesh
Prathmesh - avatar
11 odpowiedzi
+ 10
#Try this def calc(r): import math p=2*math.pi*r return p #print("to find p") r=float(input()) a=calc(r) print("p:",round(a, 2)) #It's not necessary to add extra things in the task
8th Jan 2021, 4:25 AM
Simba
Simba - avatar
+ 2
Ok , thanks Pąľľąvī and Simba 😁
8th Jan 2021, 4:26 AM
Prathmesh
Prathmesh - avatar
+ 1
the artist Recheck the link you've attached in the Question .
8th Jan 2021, 4:19 AM
Alphin K Sajan
Alphin K Sajan - avatar
+ 1
def calc(r): import math p=2*math.pi*r return p print("to find p") r=float(input("Enter Radius :")) a=calc(r) print("p:",round(a, 2))
8th Jan 2021, 4:21 AM
Prathmesh
Prathmesh - avatar
+ 1
#use this short code from math import pi radius = int(input()) perim = 2*pi*radius print(round(perim, 2))
3rd Apr 2021, 2:13 PM
Allan 🔥STORMER🔥🔥🔥🔥
Allan 🔥STORMER🔥🔥🔥🔥 - avatar
0
Wait I will post question and my code
8th Jan 2021, 4:20 AM
Prathmesh
Prathmesh - avatar
0
You are given a program that takes the radius of a circle as the input. Complete the code to calculate the circle's perimeter and output the result. Remember, the perimeter of a circle = 2*pi*radius Sample Input 5 Sample Output 31.42 You need to import the pi constant from the math module to perform the calculation.
8th Jan 2021, 4:21 AM
Prathmesh
Prathmesh - avatar
0
And output is 31.42 of the code but it gives error 😐
8th Jan 2021, 4:22 AM
Prathmesh
Prathmesh - avatar
8th Jan 2021, 4:23 AM
Prathmesh
Prathmesh - avatar