Skip to content

Commit 0b26d31

Browse files
authored
Merge pull request #773 from YasarMert/master
Added types_yasarmert_turkmen.py
2 parents fb78cb4 + 4dd3a02 commit 0b26d31

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

‎Week02/types_yasarmert_turkmen.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
my_int = 3
2+
my_float = 3.14
3+
my_bool = True
4+
my_complex = 1 + 2j
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def calculate_pyramid_height(number_of_blocks):
2+
height = 0
3+
blocks = 0
4+
while blocks + height < number_of_blocks:
5+
height += 1
6+
blocks += height
7+
return height
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def remove_duplicates(seq: list) -> list:
2+
a_list = []
3+
for i in seq:
4+
if i not in a_list:
5+
a_list.append(i)
6+
return a_list
7+
8+
def list_counts(seq: list) -> dict:
9+
a_dict = {}
10+
for i in seq:
11+
a_dict[i] = seq.count(i)
12+
return a_dict
13+
14+
def reverse_dict(d: dict) -> dict:
15+
a_dict = {}
16+
for key, value in d.items():
17+
a_dict[value] = key
18+
return a_dict

0 commit comments

Comments
 (0)