私はインターネット上でこの問題の解決策を見つけることができませんでした(おそらく私は十分に調べていません)が、入力を数値だけにする方法がわかりません。入力にいくつかの方程式を通過させようとしていますが、入力に文字を入力するたびにプログラムが停止します。入力が文字か数字かを検出する方法があるかどうか疑問に思っていました。私のプログラムを紹介します。
Radius=input("What is the radius of the circle/sphere?")
Areacircle=(int(Radius)**2)*3.14159265359
Perimetercircle=2*3.14159265359*int(Radius)
Permsphere=4*3.14159265359*(int(Radius)**2)
Areasphere=(4/3)*3.14159265359*(int(Radius)**3)
print("The radius' length was:",Radius)
print("The surface area of each circle is:",Areacircle)
print("The perimeter of the circle is:",Perimetercircle)
print("The volume of the sphere would be:",Areasphere)
print("The perimeter of the Sphere would be:",Permsphere)