Skip to content

Commit 30c69e2

Browse files
sintezsintez
sintez
authored and
sintez
committed
Initial commit
0 parents  commit 30c69e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+308
-0
lines changed

.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/pyCoursera.iml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hw1/100A

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print(100 * "A")

hw1/DigitClock1

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
n = int(input())
2+
hours = n % (60 * 24) // 60
3+
minutes = n % 60
4+
print(hours, minutes)

hw1/SalaryBread1

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
a = int(input())
2+
b = int(input())
3+
n = int(input())
4+
cost = n * (100 * a + b)
5+
print(cost // 100, cost % 100)

hw1/__init__.py

Whitespace-only changes.

hw1/apples1

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
n = int(input())
2+
k = int(input())
3+
print(k // n)

hw1/apples2

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
n = int(input())
2+
k = int(input())
3+
print(k % n)

hw1/countDigit

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
i = int(input())
2+
print(i // 10)

hw1/hello

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name = input()
2+
print("Hello,", name, sep=' ', end="!")
3+
print(u"Привет")

hw1/hw1.1.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a = int(input())
2+
b = int(input())
3+
if a >= b:
4+
print(a)
5+
else:
6+
print(b)

hw1/lastDigit

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
i = int(input())
2+
print(i % 100 % 10)

hw1/nextPrivNumber

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
n = int(input())
2+
print('The next number for the number ', n, ' is ', n + 1, '.', sep='')
3+
print('The previous number for the number ', n, ' is ', n - 1, '.', sep='')

hw1/pinguins

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
v = int(input())
2+
a1 = ' _~_ '
3+
a2 = ' (o o) '
4+
a3 = ' / V \ '
5+
a4 = '/( _ )\ '
6+
a5 = ' ^^ ^^ '
7+
8+
print(a1 * v)
9+
print(a2 * v)
10+
print(a3 * v)
11+
print(a4 * v)
12+
print(a5 * v)

hw1/secondDigit

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
i = int(input())
2+
print(i // 10 % 10)

hw1/sum3Digit

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
i = int(input())
2+
a = i // 100
3+
b = i % 100 // 10
4+
c = i % 100 % 10
5+
sum = a + b + c
6+
print(sum)

hw1/twoPower

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
i = int(input())
2+
print(2 ** i)

hw2/__init__.py

Whitespace-only changes.

hw2/boxes

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
A1 = int(input()) # Box 1
2+
B1 = int(input())
3+
C1 = int(input())
4+
A2 = int(input()) # Box 2
5+
B2 = int(input())
6+
C2 = int(input())
7+
if ((A1 == A2 and B1 == B2 and C1 == C2) or
8+
(A1 == A2 and B1 == C2 and C1 == B2) or
9+
(A1 == C2 and B1 == A2 and C1 == B2) or
10+
(A1 == B2 and B1 == A2 and C1 == C2) or
11+
(A1 == B2 and B1 == C2 and C1 == A2) or
12+
(A1 == C2 and B1 == B2 and C1 == A2)):
13+
print('Boxes are equal')
14+
elif ((A1 <= A2 and B1 <= B2 and C1 <= C2) or
15+
(A1 <= A2 and B1 <= C2 and C1 <= B2) or
16+
(A1 <= C2 and B1 <= A2 and C1 <= B2) or
17+
(A1 <= B2 and B1 <= A2 and C1 <= C2) or
18+
(A1 <= B2 and B1 <= C2 and C1 <= A2) or
19+
(A1 <= C2 and B1 <= B2 and C1 <= A2)):
20+
print('The first box is smaller than the second one')
21+
elif ((A1 >= A2 and B1 >= B2 and C1 >= C2) or
22+
(A1 >= A2 and B1 >= C2 and C1 >= B2) or
23+
(A1 >= C2 and B1 >= A2 and C1 >= B2) or
24+
(A1 >= B2 and B1 >= A2 and C1 >= C2) or
25+
(A1 >= B2 and B1 >= C2 and C1 >= A2) or
26+
(A1 >= C2 and B1 >= B2 and C1 >= A2)):
27+
print('The first box is larger than the second one')
28+
else:
29+
print('Boxes are incomparable')

hw2/castleIF

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
a, b, c = int(input()), int(input()), int(input())
2+
d, e = int(input()), int(input())
3+
if (d >= a and e >= b):
4+
print("YES")
5+
elif (d >= b and e >= a):
6+
print("YES")
7+
elif (d >= b and e >= c):
8+
print("YES")
9+
elif (d >= c and e >= b):
10+
print("YES")
11+
elif (d >= a and e >= c):
12+
print("YES")
13+
elif (d >= c and e >= a):
14+
print("YES")
15+
else:
16+
print("NO")

hw2/count4etnDigits

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
x = 1
2+
k = 0
3+
while x != 0:
4+
x = int(input())
5+
if x != 0 and x % 2 == 0:
6+
k += 1
7+
print(k)

hw2/countEqualsMax

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
prev = -1
2+
curr_rep_len = 0
3+
max_rep_len = 0
4+
element = int(input())
5+
while element != 0:
6+
if prev == element:
7+
curr_rep_len += 1
8+
else:
9+
prev = element
10+
max_rep_len = max(max_rep_len, curr_rep_len)
11+
curr_rep_len = 1
12+
element = int(input())
13+
max_rep_len = max(max_rep_len, curr_rep_len)
14+
print(max_rep_len)

hw2/countMax

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
now = int(input())
2+
nowMax = now
3+
count = 1
4+
while now != 0:
5+
now = int(input())
6+
if now == nowMax:
7+
count += 1
8+
elif now > nowMax:
9+
nowMax = now
10+
count = 1
11+
print(count)

hw2/equalsDigit

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
a, b, c = int(input()), int(input()), int(input())
2+
if (a == b == c):
3+
print(3)
4+
elif (a == b) or (a == c) or (b == c):
5+
print(2)
6+
elif (a != b) and (a != c) and (c != b):
7+
print(0)

hw2/kows

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
n = int(input())
2+
if n % 10 == 2 or n % 10 == 3 or n % 10 == 4:
3+
if n < 12 or n > 14:
4+
print(n, 'korovy')
5+
else:
6+
print(n, 'korov')
7+
elif n != 11 and n % 10 == 1:
8+
print(n, 'korova')
9+
else:
10+
print(n, 'korov')

hw2/langSequence

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
x = int(input())
2+
k = 1
3+
while x != 0:
4+
x = int(input())
5+
k += 1
6+
print(k - 1)

hw2/listSquards

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
N = int(input())
2+
i = 1
3+
z = 1
4+
while z <= N:
5+
print(z)
6+
i = i + 1
7+
z = i ** 2

hw2/max3digit

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
a = int(input())
2+
b = int(input())
3+
c = int(input())
4+
if a >= b and a >= c:
5+
print(a)
6+
elif b >= a and b >= c:
7+
print(b)
8+
else:
9+
print(c)

hw2/maxDigit

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
a = int(input())
2+
b = int(input())
3+
if a > b:
4+
print(1)
5+
elif a < b:
6+
print(2)
7+
else:
8+
print(0)

hw2/minDel

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
n = int(input())
2+
i = 2
3+
if n % i == 0:
4+
print(i)
5+
while n % i != 0:
6+
i = (i + 1)
7+
if n % i == 0:
8+
print(i)

hw2/posl

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
now = int(input())
2+
nowMax = now
3+
while now != 0:
4+
if now > nowMax:
5+
nowMax = now
6+
now = int(input())
7+
print(nowMax)

hw2/running

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
x, y = float(input()), float(input())
2+
i = 1
3+
while x < y:
4+
i = i + 1
5+
x = x * 1.1
6+
print(i)

hw2/secondMax

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
now = int(input())
2+
nowMax = now
3+
secMax = 0
4+
while now != 0:
5+
now = int(input())
6+
if nowMax <= now:
7+
secMax = nowMax
8+
nowMax = now
9+
elif nowMax >= now >= secMax:
10+
secMax = now
11+
print(secMax)

hw2/sortDigit

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
a, b, c = int(input()), int(input()), int(input())
2+
if (a >= b >= c):
3+
print(c, b, a)
4+
elif (b >= a >= c):
5+
print(c, a, b)
6+
elif (c >= a >= b):
7+
print(b, a, c)
8+
elif (c >= b >= a):
9+
print(a, b, c)
10+
elif (b >= c >= a):
11+
print(a, c, b)
12+
elif (c >= b >= a):
13+
print(c, b, a)
14+
elif (a >= c >= b):
15+
print(b, c, a)

hw2/sumSequence

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
x = int(input())
2+
s = x
3+
while x != 0:
4+
x = int(input())
5+
s += x
6+
print(s)

hw2/sumSquardDigit

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
n = int(input())
2+
i = 0
3+
s = 0
4+
while (i != n):
5+
i += 1
6+
s += (i ** 2)
7+
continue
8+
print(s)

hw2/years

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
a = int(input())
2+
if (a % 4 == 0) and (not (a % 100 == 0)) or a % 400 == 0:
3+
print("YES")
4+
else:
5+
print('NO')

hw3/__init__.py

Whitespace-only changes.

hw3/fractionalPart.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import math
2+
3+
f = float(input())
4+
print(f - math.floor(f))

hw3/priceProduct.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
x = float(input())
2+
k = (x % 1) * 100
3+
print(int(x), int(round(k)))

hw3/procDeposit.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
p, x, y = int(input()), int(input()), int(input())

hw3/roundRus.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from math import floor, ceil
2+
3+
x = float(input())
4+
k = x % 1
5+
if k >= 0.5:
6+
print(ceil(x))
7+
else:
8+
print(floor(x))

hw3/rowSumm.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
n = int(input())
2+
counter = 1
3+
last = 0
4+
while counter <= n:
5+
last += 1 / (counter ** 2)
6+
counter += 1
7+
print(last)

hw3/sTriangle

Whitespace-only changes.

hw3/sTrigl.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
a, b, c = float(input()), float(input()), float(input())
2+
p = (a + b + c) / 2
3+
s = (p * (p - a) * (p - b) * (p - c)) ** (1 / 2)
4+
print(s)

0 commit comments

Comments
 (0)