math - getting a repatted generated answer in python -
i trying make program can me on finding area using radius. output weird, take look!
pi = 3.1415929203539825 print('what radius') #asking radius r = input() = str(pi) * int(r) * int(r) print("the area of circle " + str(a) + "")
when r = 5, outputs:
3.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.14159292035398253.1415929203539825
you don't need cast pi string. doing repeats string
try instead
from math import pi r = float(input("enter radius: ")) = pi * (r**2)
Comments
Post a Comment