I'm having a user input info for a program and I'm having trouble storing information from user without it overwriting in a loop. My code as follows:
def main():
total_circles = input("Enter the number of circles: ")
for number in range(1, int(total_circles) + 1):
circles = input("Enter the radius of circle {}: ".format(number))
circle_value = float(circles)
circle_value = [] + [circle_value]
Is there a way to store each radii input into a variable to be added into the list cValue?
Output:
Enter the number of circles: 2
Enter the radius of circle 1: 7
Enter the radius of circle 2: 4
circle_value.append(float(circles))should do the trick instead ofcircle_value = float(circles)