Practice Python : Basic Exercises for Beginners # 011 - The perfect number

preview_player
Показать описание
Coding exercises with solutions for Python developers.
Practice and quickly learn programming necessary skills by solving Python exercises and problems.

In this video you will learn how to write a program in Python that asks the user to enter an integer n and to display whether this number is perfect or not.
a perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself.

Topics:
the "input()" function : is used to ask the user to enter the number.
the "int()" function converts the specified value into an integer number.
the "range()" function returns a sequence of numbers, in a given range, the most common use of it is to iterate on a sequence of numbers using Python loops.
Рекомендации по теме