Skip to content
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
6 changes: 6 additions & 0 deletions Task 1/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# single-string comment

'''
multi-string comment
:)
'''
14 changes: 14 additions & 0 deletions Task 10/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
num_1 = 13
str_1 = "it's a string"
list_1 = ["it's a string in the list"]
dict_1 = {
num_1 : 666,
"it's a key" : str_1,
num_1 + 50 : num_1,
str_1[0] : list_1,
str_1 : list_1[0],
69 : 69
}
num_2 = dict_1[num_1]
print(num_2)
print(dict_1)
9 changes: 9 additions & 0 deletions Task 11/YTypucT/YTypuct.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
for i in range(2):
num = int(input())
if num == 70:
print(70)
elif num == 68:
print(68)
elif num:
print (num)
else: print ('Ups')
10 changes: 10 additions & 0 deletions Task 12/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
num = 69
str = "it's a string"

if num and str[1] == 't':
print ('yep')
else: print('no')
if num == 69:
if len(str)>1:
print ('cool')

1 change: 1 addition & 0 deletions Task 13/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print ('скипнул')
14 changes: 14 additions & 0 deletions Task 14/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
list = [13, 13, 13]
str = "it's a string!"
dict = {
25: 'Word',
'Key': 13
}
for s in str:
print(s)
for el in list:
print(el)
for key in dict:
print(dict[key])
for i in range(100, 50, -10):
print(i)
13 changes: 13 additions & 0 deletions Task 15/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
list = [13, 1313, 131313, 666]

for num in list:
if num > 5000:
print('Num ' + str(num) + ' greater than 5000')
continue
print(':c')
else: print('Num less than 5000')

for num in list:
if num == 1313:
print('The number of found')
break
16 changes: 16 additions & 0 deletions Task 16/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
num_1 = 10
num_2 = 0

while num_1 > 0:
print(num_1)
num_1 -= 1
else: print('Cycle completed')

while num_2 != 10 or num_2 == 9:
if num_2 > 4:
print('Cool', num_2)
if num_2 == 8:
print('8. exit.')
break
num_2 += 1

14 changes: 14 additions & 0 deletions Task 17/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
list_1 = [[28, 70, 36], ['Line 1', "Line 2"]]
num_1 = 69
num_2 = num_1 ** 1
str_1 = 'Line'
num_3 = 0

for el_1 in list:
for el_2 in el_1:
print(el_2)

while num_3 < 2:
for el in list[num_3]:
print(el)
num_3+=1
1 change: 1 addition & 0 deletions Task 18/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print ("skip'нул")
1 change: 1 addition & 0 deletions Task 19/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print ("skip'нул")
16 changes: 16 additions & 0 deletions Task 2/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
num_1 = 1

num_1 + 5
num_1 - 3
num_1 * 4
num_1 / 4

num_2 = 69
num_2 += num_1

num_3 = 666
num_3 -= num_2

num_4 =- num_3

print (num_1, num_2, num_3, num_4)
13 changes: 13 additions & 0 deletions Task 20/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def main ():
num_1 = func_1(int(input('Enter 1st number:')), int(input('Enter 2nd number:')))
str_1 = func_2(input('Enter any line:'))
print (num_1)
print (str_1)

def func_1(a, b):
return a ** b

def func_2(str_1):
return str_1 + "!"

main()
1 change: 1 addition & 0 deletions Task 21/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print ("skip'нул")
14 changes: 14 additions & 0 deletions Task 22/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name = input ('Enter your first name: ')
age = int (input('Enter your age: '))

def main ():
func_1(name)
func_2(age)

def func_1 (name):
print ('Hello ' + name + '!')

def func_2 (age):
print ('Your age is '+ str(age) + '!')

main()
15 changes: 15 additions & 0 deletions Task 23/YtypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
num_1 = 69
str_1 = "It's a line"
list_1 = ["It's a list"]
dict_1 = {69: "it's a dictionary"}

print(type(num_1), type(str_1), type(list_1), type(dict_1))

class Animal:
def __init__(self):
print('Animal class constructor')

cat = Animal()

print(type(cat))
print(cat)
10 changes: 10 additions & 0 deletions Task 24/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class Animal:
def __init__(self, name, color, type = 'Animal'):
self.name = name
self.color = color
self.type = type
def out(self):
print ("It's a %s. It's name %s. It's a %s." % (self.type, self.name, self.color))

cat_1 = Animal(input('Enter name: '), input('Enter color: '), input('Enter type: '))
cat_1.out()
28 changes: 28 additions & 0 deletions Task 25/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class Animal:
def __init__(self, kind):
self.kind = kind
def info(self):
print ("It's an %s" % (self.kind))

class Bird:
def __init__(self, kind):
self.kind = kind
def info(self):
print ("It's a %s." % (self.kind))

class Cat(Animal):
def __init__(self, name, color, kind = "Animal"):
super().__init__(kind)
self.__name = name
self.__color = color

class Parrot(Bird):
def __init__(self, name, color, kind = "Bird"):
super().__init__(kind)
self.__name = name
self.__color = color

cat = Cat('Bars', 'Green')
parrot = Parrot ('Popka', 'Red')
cat.info()
parrot.info()
5 changes: 5 additions & 0 deletions Task 3/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from math import sqrt
print (666)
print (int(sqrt(25-16)+66))
num_1 = 13
print (num_1, num_1**2, '|M a n y l e t t e r s|', 'two time '*2)
6 changes: 6 additions & 0 deletions Task 4/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
str_1 = 'String'
str_2 = "another string"
str_3 = str_1
str_3 += ' '
str_3 += str_2
print (str_1, str_2, str_3, sep = '\n')
8 changes: 8 additions & 0 deletions Task 5/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
list_1 = [[], 8, 'String']
list_2 = list_1
print (list_2)
list_2.append(5)
list_2.remove(8)
list_2.reverse()
list_2.insert(2, ':)')
print (list_2)
4 changes: 4 additions & 0 deletions Task 6/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
list_1 = ['ughm', 6]
list_2 = list_1[1]
list_1[0] += 'hrr'
print(list_1, list_2)
5 changes: 5 additions & 0 deletions Task 7/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
str_1 = "it's a string\n"
str_2 = "it's too, but this string is sad"
str_3 = str_1 + str_2
str_4 = 'qwerty'
print (str_3, str_4[2], sep= '\n')
11 changes: 11 additions & 0 deletions Task 8/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
list_1=[[6, 6, 6], ['he', 'he']]
print(list_1[0], list_1[1])
num_1 = 8
list_2 = list_1[0]
list_3 = list_1[num_1 - 7]
print(list_2, list_3)
num_2 = list_1[0][2]
num_3 = list_2[2]
num_4 = list_1[0][0] + list_1[0][1] - 6
str_1 = list_1[1][0]
print(num_2, num_3, num_4, str_1)
17 changes: 17 additions & 0 deletions Task 9/YTypucT/YTypucT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
dict_1 = {
'Я строка-ключ в словаре' : "Я строка-значение строки-ключа в словаре",
50 : 93,
"Я другая строка-ключ в словаре" : ['Я строка в списке', 90],
'Я ещё одна строка-ключ в словаре' : 32,
73 : 'Я строка-значение числа-ключа в словаре',
"Я строка-ключ, моё значение - пустой словарь" : {},
}
print(dict_1[73])
del(dict_1[50])
dict_1.update({
53 : 33,
66 : 666
})
print(dict_1)
print(dict_1.values())
print(dict_1.keys())