+ 2

How can I get the perfect numbers from 1 to 10000 using for loops. No functions

14th Aug 2020, 10:36 AM
Roy
Roy - avatar
2 Réponses
14th Aug 2020, 11:25 AM
Faisal Rahman
Faisal Rahman - avatar
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.
14th Aug 2020, 11:07 AM
Bits!