0
What is wrong in this code? plz help
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
+ 1
the artist Recheck the link you've attached in the Question .
+ 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))
+ 1
#use this short code
from math import pi
radius = int(input())
perim = 2*pi*radius
print(round(perim, 2))
0
Wait I will post question and my code
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.
0
And output is 31.42 of the code but it gives error 😐
0
Pąľľąvī ??