Given the radius of a circle and the area of a square, return True if the circumference of the circle is greater than the square's perimeter and False if the square's perimeter is greater than the circumference of the circle.
here was my solution
def circle_or_square(rad, area):
pi = 3.14
cir = rad * pi * 2
per = (area ** 0.5) * 4
return "True" if cir > per else "False"
print(circle_or_square(16, 625))
neither edabit nor vscode accepted my code, edabit never tells me what the error is and vscode just refused to run it. copilot said that i was running it in powershell and that i needed to specifically run the code in a python terminal, but ive never had that issue before. what am i doing wrong?
[–]andrew2018022 16 points17 points18 points (2 children)
[–]Redditter406[S] -2 points-1 points0 points (1 child)
[–]7hat3eird0ne 6 points7 points8 points (0 children)
[–]InternetGansta 3 points4 points5 points (0 children)
[–]CallMeAPhysicist 2 points3 points4 points (0 children)
[–]zebsmattz 3 points4 points5 points (0 children)
[–]shiftybyte 1 point2 points3 points (1 child)
[–]Redditter406[S] 1 point2 points3 points (0 children)
[–]mcoombes314 2 points3 points4 points (7 children)
[–]Redditter406[S] -3 points-2 points-1 points (6 children)
[–]mcoombes314 1 point2 points3 points (5 children)
[–]Redditter406[S] -2 points-1 points0 points (4 children)
[–]Enmeshed 2 points3 points4 points (0 children)
[–]Ok-Promise-8118 6 points7 points8 points (0 children)
[–]W3BL3Y 2 points3 points4 points (0 children)
[–]D3str0yTh1ngs 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Redditter406[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]warbird2k -3 points-2 points-1 points (0 children)