Всякий раз, когда я запускаю код, он просто возвращает сообщение «Пожалуйста, введите радиус для расчета». Как будто он никогда не прерывает цикл и не начинает с while true.
Код: Выделить всё
import math
radius = input()
#Area
x = math.pi*radius**2
#Circumference
y = 2*math.pi*radius**2
while True:
print('Enter a radius for calculation: ')
try:
radius = int(radius)
except:
print('Please use numeric digit.')
continue
if radius < 1:
print('Please enter a positive number.')
continue
break
print ('The area is', x)
print ('The circumference is', y)
Подробнее здесь: https://stackoverflow.com/questions/792 ... and-printi
Мобильная версия