1)
a = int(input('Введите A: '))
b = int(input('Введите B: '))
for i in range (a,b+1):
print(i**2)
2)
x = -4
while x <= 4:
print(x**3-x**2+16*x-43)
x += 0.5
3)
n = int(input("n="))
lst = []
for i in range(2, n+1):
for j in range(2, i):
if i % j == 0:
break
else:
lst.append(i)
print(*lst)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
1)
a = int(input('Введите A: '))
b = int(input('Введите B: '))
for i in range (a,b+1):
print(i**2)
2)
x = -4
while x <= 4:
print(x**3-x**2+16*x-43)
x += 0.5
3)
n = int(input("n="))
lst = []
for i in range(2, n+1):
for j in range(2, i):
if i % j == 0:
break
else:
lst.append(i)
print(*lst)