FindDividersOfNumber. Python tutorials. Simple Input/Output. Algorithms. Console Application. A console application in the Python programming language. The program does the following:
- Asks the user to enter a positive integer.
- The message displayed is: "The number has the following divisors:"
- The loop with the parameter is executed:
- The initial value of the parameter is set to 1, and the final value is set to the number entered from the keyboard.
- A series of loops is executed, where the remainder from dividing the number entered from the keyboard by the loop variable-parameter is calculated.
- If the remainder is zero, the value of the loop parameter is displayed on the screen.
- The value of the loop parameter is compared with the final value. If it is less, the loop is executed. Otherwise, it terminates.
- The loop parameter variable is incremented by the loop increment. In this example, it is 1. Developed in the Spyder integrated environment (in the Microsoft Visual Studio Code editor).
FindDividersOfNumber. Занятия по Python. Простой ввод-вывод. Алгоритмы. Консольное приложение. Консольное приложение написанное на языке программирования Python. Программа делает следующее:
- Просит пользователя ввести целое положительное число.
- Выводится сообщение:"Число имеет следующие делители:"
- Выполняется цикл с параметром:
- Начальное значение параметра уставливается равным 1, а конечное - числу, введённому с клавиатуры.
- Выполняется серия цикла, где вычисляется остаток от деления числа, введённого с клавиатуры на переменную-параметр цикла.
- Если остаток равен нулю, то значение параметра цикла выводится на экран.
- Значение параметра цикла сравнивается с конечным. Если оно меньше цикл выполняется. В противном случае - завершается.
- Переменная параметра цикла увеличивается на шаг цикла. В данном примере он равен 1.
Разработано в интегрированной среде Spyder (в редакторе Microsoft Visual Studio Code).