This repository has been archived on 2025-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Files
python_it_top/Practica3/task2_rpo254.py
2025-09-18 19:22:01 +05:00

27 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

a = int(input("start ")) #нач диап
b = int(input("end ")) #кон диап
num = int() #иниц переменной
print("1:")
for i_one in range(a, b+1):
print(i_one, end=' ') #end=' ' делает пробел над каждым числом который выводит i_one. Сделанно для нормальной прочитанности ответа.
print("\n") #Типичная табуляция, узнал об этом в си. Делает каждый раз переход на новую строку, ну или n = new line
print("2:")
for i_two in range(b, a -1, -1):
print(i_two, end=' ')
print("\n")
print("3:")
for i_three in range(a, b+1):
if i_three % 7 == 0: # Если i_three делится без остатка на 7 и остаток сравним с 0 то выполнять условие дальше. Я понимаю работу этого выражения.
print(i_three, end=' ')
print("\n")
for i_four in range(a, b+1):
if i_four % 5 == 0:
num += 1
print("4:", num)