Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prjamilova viktorija sergeevna #221

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions #task1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#task2
def count_sheeps(sheep):
return sheep.count(True)


#task3
def monkey_count(n):
result = []
for num in range(1, n + 1):
result.append(num)
return result
monkey_count(10)


#task4
def paperwork(n, m):
return n * m if n > 0 and m > 0 else 0
paperwork(10,16)


#task5
def hero(b, d):
bulletsneeded = d * 2
if b >= bulletsneeded:
return True
else:
return False
hero(30,10)
#task1
def polish_letters(s):
polish = {"ą": "a", "ć": "c", "ę": "e", "ł": "l", "ń": "n", "ó": "o", "ś": "s", "ź": "z", "ż": "z"}
return "".join([polish[c] if c in polish else c for c in s])

#task2
def sum_of_minimums(numbers):
result = 0
for i in numbers:
result += min(i)
return result



#task3
list = []


def find_all(list, x):
l = len(list)
result = []
for i in range(0,l):
if x == list[i]:
result.append(i)
return result


29 changes: 29 additions & 0 deletions lab1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import math

a = 0.1
b = 0.5


def y(x):
return (a + (math.tan(b * x)) ** 2) / (b + (1/math.tan(a * x)) ** 2)


# task №17 A
print("task №17 A")

x_first = 0.15
x_last = 1.37
step = 0.25

x = x_first
while x < x_last:
print(f"x = {x} y = {y(x)}")
x += step

# task №17 B
print("task №17 B")

array_x = [0.2, 0.3, 0.44, 0.6, 0.56]
for x in array_x:
print(f"x = {x} y = {y(x)}")