+ 2
How can I get the perfect numbers from 1 to 10000 using for loops. No functions
2 Respostas
0
Thats so easy. You can check my code below in python having output of perfect numbers from 1 to 1000. Enjoy 🤘
➡️CODE⬇️ https://code.sololearn.com/cN0ZNoA3M3u4/?ref=app
In programming, Loops are used to repeat a block of code until a specific condition is met. A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times. Also, we are going to use one of Python’s built-in function range(). This function is extensively used in loops to control the number of types of the loop that have to run. In simple words range is used to generate a sequence between the given values.