Task 2 [Low-quality graphics circle] This task is to help you practice nested for-loops (for-loop inside a for-loop) and if-statements. Hint: if you want to print a new line, you can print an empty string, e.g., print(""). For this task, we will draw a simple text-based circle. Recall that a circle is described as follows: x² + y² = r² Any x, y value, such that x² + y² ≤ r², will be a point inside or on the circle. With this simple information, we can draw a circle. Your task should work as follows: (1) Ask the user to input a radius from [1 to 10]. -> You can assume the input is an integer -> If the value is not between 1 and 10, keep asking radius r ² x² + y² < All x,y points x² + y² = ² Points exactly on the circle. x
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.
To print a circle pattern.
Step by step
Solved in 3 steps with 1 images