# 1
a = [1, 1, 2, 3, 5, 6, 13, 21, 34, 55, 89]
for element in a:
if element < 5:
print(element)
# 2
n = int(input())
print(n + n*n + n*n*n)
# 3
a = [1, 1, 2, 3, 5]
b = [1, 2, 3, 4, 5]
for index in range(len(a)):
if a[index] == b[index]:
print(a[index])
# 4
for i in range(1, n + 1):
print('*' * i)
# 5
def are_first_and_last_equal(array):
return array[0] == array[len(array) - 1]
# 6
def arifmetic(number_a, number_b, operation):
if operation == '+':
return number_a + number_b
if operation == '-':
return number_a - number_b
if operation == '*':
return number_a * number_b
if operation == '/':
return number_a / number_b
else:
return "Невідома операція"
# 7
side_a = int(input())
side_b = int(input())
area = side_a * side_b
print(area)
print(area > 0)
# 8
def season(month_number):
if month_number >= 1 and month_number <= 2 or month_number == 12:
return "зима"
elif month_number >= 3 and month_number <= 5:
return "весна"
elif month_number >= 6 and month_number <= 8:
return "літо"
elif month_number >= 9 and month_number <= 11:
return "осінь"
# 9
def bank(a, years):
return a * 1.10 ** years
# 10
def celsius_to_fahrenheit(celsius):
return celsius * 1.8 + 32
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
# 1
a = [1, 1, 2, 3, 5, 6, 13, 21, 34, 55, 89]
for element in a:
if element < 5:
print(element)
# 2
n = int(input())
print(n + n*n + n*n*n)
# 3
a = [1, 1, 2, 3, 5]
b = [1, 2, 3, 4, 5]
for index in range(len(a)):
if a[index] == b[index]:
print(a[index])
# 4
n = int(input())
for i in range(1, n + 1):
print('*' * i)
# 5
def are_first_and_last_equal(array):
return array[0] == array[len(array) - 1]
# 6
def arifmetic(number_a, number_b, operation):
if operation == '+':
return number_a + number_b
if operation == '-':
return number_a - number_b
if operation == '*':
return number_a * number_b
if operation == '/':
return number_a / number_b
else:
return "Невідома операція"
# 7
side_a = int(input())
side_b = int(input())
area = side_a * side_b
print(area)
print(area > 0)
# 8
def season(month_number):
if month_number >= 1 and month_number <= 2 or month_number == 12:
return "зима"
elif month_number >= 3 and month_number <= 5:
return "весна"
elif month_number >= 6 and month_number <= 8:
return "літо"
elif month_number >= 9 and month_number <= 11:
return "осінь"
# 9
def bank(a, years):
return a * 1.10 ** years
# 10
def celsius_to_fahrenheit(celsius):
return celsius * 1.8 + 32