mirea-projects/First term/Informatics/IT-7.md
2024-09-24 02:22:33 +03:00

1.3 KiB
Executable File
Raw Permalink Blame History

Рабочая тетрадь № 7

Задачи № 1

№ 1

А) 0, 0, 0, 5 
Б) 0, 0, 5, 0 
В) 10, 10, 20, 6

№ 2

1) s1 = 1, n = 1, n = 2, s = 1,5
2) s1 = 1, n = 2, n = 3, s1 = 1,8
3) 1,8 3 4 2,08 
4) 2,08 4 5 2,8

№ 3

5

№ 4

А) z = 1
Б) z = 1,9375

Задачи № 2

№ 1

image

№ 2

image

№ 3

image

Задачи № 3

№ 1

n = 10
b = 2
k = a // b
l = n % b
print("Остаток:", k)
print("Целая часть:", l)

№ 2

def Sign(x):
    if x < 0:
        return -1
    elif x > 0:
        return 1
    return 0

№ 3

word = str(input())

if word == word[::-1]:
  print("yes")
else:
  print("no")

№ 4

sec = int(input())
 
day = 86400
hour = 3600
minute = 60
second = 1

print(sec // day, (sec % day) // hour, ((sec % day) % hour) // minute, ((sec % day) % hour) % minute, sep=':')

№ 5

def fibonacci_of(n):
    if n in {0, 1}:
        return n
    return fibonacci_of(n - 1) + fibonacci_of(n - 2)
 

print(fibonacci_of(int(input())))