i'm trying create function prompt user give radius each circle have designated having, however, can't seem figure out how display without running typeerror: input expected @ 1 arguments, got 2
def getradius(): num_circles = eval(input("enter number of circles: ")) in range(num_circles): radius = eval(input("enter radius of circle #", + 1)) getradius()
that's because gave second argument. can give string want see displayed. isn't free-form print statement. try this:
radius = eval(input("enter radius of circle #" + str(i + 1)))
this gives single string value send input.
also, very careful using eval.
Comments
Post a Comment