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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -