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
14 changes: 14 additions & 0 deletions 2. max.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
huge = 1
big = 0
a = 1
while a > 0:
a = int(input())

if a > big and a > huge:
big = huge
huge = a

if a > big and a < huge:
big = a

print(big)
12 changes: 12 additions & 0 deletions Chasy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
min = int(input())
if min > 1439:
alfa = min // 1440
min = min - alfa * 1440

if min < 60:
print(0, ' ', min)

if min >= 60:
hour = min // 60
min = min - hour * 60
print(hour, ' ', min)
8 changes: 8 additions & 0 deletions Factorial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
n = int(input())
sum = 0
fact = 1
for i in range(1, n + 1):
fact = i * fact
sum = sum + fact

print(sum)
14 changes: 14 additions & 0 deletions Improved/2..max negat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
huge = -9998
big = -9999
a = int(input())
while a < 0:


if a > big and a > huge:
big = huge
huge = a

if a > big and a < huge:
big = a
a = int(input())
print(big)
12 changes: 12 additions & 0 deletions Improved/Chasy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
minimum = int(input())
if minimum > 1439:
alfa = minimum // 1440
minimum = minimum - alfa * 1440

if minimum < 60:
print(0, ' ', minimum)

if minimum >= 60:
hour = minimum // 60
minimum = minimum - hour * 60
print(hour, ' ', minimum)
9 changes: 9 additions & 0 deletions Improved/Factorial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
n = int(input())
summa = 0
fact = 1
for i in range(1, n + 1):
fact = i * fact
fact = i * fact
summa = summa + fact

print(summa)
12 changes: 12 additions & 0 deletions Improved/MKAD.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
v = int(input())
t = int(input())
s = v*t


p = s % 109




print(s)
print(p)
6 changes: 6 additions & 0 deletions MKAD.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
v = int(input())
t = int(input())
s = v*t
alfa = s // 109
s = s - alfa*109
print(s)
13 changes: 13 additions & 0 deletions min iz 3 chisel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
a = int(input())
b = int(input())
c = int(input())

if a <= b:
small = a
else:
small = b

if c <= small:
small = c

print(small)
13 changes: 13 additions & 0 deletions week02/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os
import sys
def hi():
print(os.getcwd())
print('hello, world')

def by():
print('by, by')

if __name__ == '__main__':
print('hi')
hi()
by()
16 changes: 16 additions & 0 deletions week03/turtle10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import turtle

turtle.shape('turtle')
turtle.speed(10)
def circle(x):
for i in range(40):

turtle.forward(4)
turtle.left(360/40)


for k in range (1,7):
circle(k)
turtle.setheading(360*k / 6)

turtle.done()
18 changes: 18 additions & 0 deletions week03/turtle11.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import turtle
turtle.setheading(90)
turtle.shape('turtle')
turtle.speed(10)
def circle(x):
for i in range(40):

turtle.forward(4+x)
turtle.left(360/40)


for k in range (1,7):
circle(k)
turtle.setheading(-90)
circle(k)
turtle.setheading(90)

turtle.done()
13 changes: 13 additions & 0 deletions week03/turtle12.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import turtle
turtle.speed(10)
def dug(x):
for i in range(40):

turtle.forward(x)
turtle.right(180/40)

for i in range(5):
turtle.setheading(90)
dug(5)
dug(1)
turtle.setheading(-90)
49 changes: 49 additions & 0 deletions week03/turtle13.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import turtle
turtle.speed(1)
def circle(x):
for i in range(40):

turtle.forward(x)
turtle.left(360/40)

def dug(x):
for i in range(40):

turtle.forward(x)
turtle.right(180/40)


turtle.penup()
turtle.forward(40)
turtle.pendown()
turtle.setheading(90)
turtle.color('yellow')
turtle.begin_fill()
turtle.circle(70)
turtle.end_fill()
turtle.penup()
turtle.goto(25,10)
turtle.pendown()
turtle.color('blue')
turtle.begin_fill()
turtle.circle(20)
turtle.penup()
turtle.goto(-30,10)
turtle.pendown()
turtle.circle(20)
turtle.end_fill()
turtle.penup()
turtle.goto(-23,0)
turtle.pendown()
turtle.width(5)
turtle.color('red')
turtle.left(180)
turtle.forward(30)
turtle.penup()
turtle.goto(5,-19)
turtle.pendown()
dug(2)



turtle.done()
17 changes: 17 additions & 0 deletions week03/turtle14.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import turtle


def star(n):
for i in range(n):
turtle.forward(150)
turtle.left(180-180/n)




star(5)
turtle.penup()
turtle.forward(300)
turtle.pendown()
star(11)
turtle.done()
14 changes: 14 additions & 0 deletions week03/turtle2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import turtle

turtle.shape('turtle')
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)

turtle.done()
9 changes: 9 additions & 0 deletions week03/turtle3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import turtle

turtle.shape('turtle')
for i in range(4):
turtle.forward(50)
turtle.left(90)


turtle.done()
10 changes: 10 additions & 0 deletions week03/turtle4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import turtle

turtle.shape('turtle')
turtle.speed(5)
for i in range(100):
turtle.forward(4)
turtle.left(360/100)


turtle.done()
16 changes: 16 additions & 0 deletions week03/turtle5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import turtle

turtle.shape('turtle')
for i in range(10):

for k in range(4):
turtle.forward(50+i*10)
turtle.left(90)
turtle.penup()
turtle.right(135)
turtle.forward(7.07)
turtle.pendown()
turtle.left(135)


turtle.done()
9 changes: 9 additions & 0 deletions week03/turtle6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import turtle

turtle.shape('turtle')
for i in range(12):
turtle.forward(50)
turtle.stamp()
turtle.goto(0,0)
turtle.right(360/12)
turtle.done()
10 changes: 10 additions & 0 deletions week03/turtle7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import turtle

turtle.shape('turtle')
turtle.speed(10)
for i in range(10*100):
turtle.forward(1+i/100)
turtle.left(360/100)


turtle.done()
11 changes: 11 additions & 0 deletions week03/turtle8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import turtle

turtle.shape('turtle')
for i in range(100):


turtle.forward(50+i*10)
turtle.left(90)


turtle.done()
23 changes: 23 additions & 0 deletions week03/turtle9.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import turtle as t
t.speed(1)
def ugolnik(n,l):
for k in range(i):
t.forward(50+10*l)
t.left(360 / i)

for i in range(4,10):
t.penup()
t.goto(-10*i,-10*i)
t.setheading(0)
t.pendown()
ugolnik(i,i)









t.done()
9 changes: 9 additions & 0 deletions week04/week04_01.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#Дан список чисел. Определите, сколько в этом списке элементов, которые больше двух своих соседей,
# и выведите количество таких элементов. Крайние элементы списка никогда не учитываются, поскольку у них недостаточно соседей.

count = 0
l = list(map(int, input().split()))
for i in range(1, len(l)-1):
if (l[i-1] < l[i]) and(l[i+1] < l[i]):
count += 1
print(count)
Loading