forked from Yesen/python_math_stat
First commit
This commit is contained in:
parent
2f894038ac
commit
b1e80562e5
16
drugoe/123.py
Normal file
16
drugoe/123.py
Normal file
@ -0,0 +1,16 @@
|
||||
n = input (" " )
|
||||
n1= int(n)
|
||||
# # P(вероятность выпадения орла или решки) = 1/2= 0.5
|
||||
# # # P(1) = "вероятноcть, что решек больше у 1"
|
||||
# # # P(2) = 'вероятность, что решене больше у 2'
|
||||
# # # P (3) = 'равное число решек'
|
||||
# # P(1) = P(2)
|
||||
# Если выпадает вариант P(3), значит, чтобы при n+1 выпала решка,т.е. P=0.5
|
||||
# Отсюда верно выражение P(1) + 0.5(P(3))= P(2)+ 0.5(P(3)), учитывая, что P(1) = P(2), представим их как 0 т.е вероятность равна 0.5
|
||||
if n1 >= 1 and n1 <= 10**5:
|
||||
print (0.5)
|
||||
else:
|
||||
print ()
|
||||
|
||||
|
||||
|
18
drugoe/credit.py
Normal file
18
drugoe/credit.py
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
# credit: int = input (" Введите сумму данного кредит " )
|
||||
# pr: int = input (" Введите процентную ставку по кредиту ")
|
||||
# year: int = input (" Введите кол-во лет по кредиту ")
|
||||
# final_sum = credit + credit / 100 * pr * year
|
||||
# print(final_sum)
|
||||
|
||||
perv_vznos = input (" Введите сумму первоначального взноса " )
|
||||
vznos = int(perv_vznos)
|
||||
a = input (" Введите значение желаемой суммы кредита " )
|
||||
b = input (" Введите процентную ставку по кредиту ")
|
||||
c = input (" Введите кол-во лет по кредиту ")
|
||||
a1 = int(a)
|
||||
b1 = float(b)
|
||||
c1 = int(c)
|
||||
final_sum = (a1 - vznos) + ((a1 - vznos) / 100 * b1) * c1
|
||||
print(final_sum)
|
||||
|
102
drugoe/hello world.py
Normal file
102
drugoe/hello world.py
Normal file
@ -0,0 +1,102 @@
|
||||
|
||||
# # credit: int = input (" Введите сумму данного кредит " )
|
||||
# # pr: int = input (" Введите процентную ставку по кредиту ")
|
||||
# # year: int = input (" Введите кол-во лет по кредиту ")
|
||||
# # final_sum = credit + credit / 100 * pr * year
|
||||
# # print(final_sum)
|
||||
|
||||
# perv_vznos = input (" Введите сумму первоначального взноса " )
|
||||
# vznos = int(perv_vznos)
|
||||
# a = input (" Введите значение желаемой суммы кредита " )
|
||||
# b = input (" Введите процентную ставку по кредиту ")
|
||||
# c = input (" Введите кол-во лет по кредиту ")
|
||||
# a1 = int(a)
|
||||
# b1 = float(b)
|
||||
# c1 = int(c)
|
||||
# final_sum = (a1 - vznos) + ((a1 - vznos) / 100 * b1) * c1
|
||||
# print(final_sum)
|
||||
|
||||
# a= 1**322
|
||||
# b= 321**322
|
||||
# c= a/b
|
||||
# w= int.c*322
|
||||
# print (w)
|
||||
# print (25/100)
|
||||
|
||||
# print (round((322/(321**322)), 6))
|
||||
|
||||
# from decimal import Decimal
|
||||
# number1 = Decimal("322")
|
||||
# number2 = Decimal("321")
|
||||
# number3 = number2**322
|
||||
# number4 =number1 / number3
|
||||
# print(number4.quantize(Decimal('1.000000')))
|
||||
|
||||
# # from decimal import Decimal
|
||||
# # number1 = Decimal("322")
|
||||
# # number2 = Decimal("0.0031152647975078")
|
||||
# # number3 = number2**322
|
||||
# # # print(number1*number3)
|
||||
|
||||
# # print(pow(0.0031152647975078, 322))
|
||||
|
||||
# # print (321**322)
|
||||
# # print(321**322)
|
||||
|
||||
# # from decimal import Decimal
|
||||
# # number1 = Decimal("1")
|
||||
# # number2 = Decimal("1243427403367201317393839301441743747728372586525670766261640905620809506005587639080279955406183542710879519297596480474251532052264053522247101137843549025799051484953585952784850325557214920862419103754250378054748361864221285507407958456970340557601822416379088854977906548248843321368085906291446155298147765800006733873921195716852574867930071563891483652506398305540218047871687996232303256042568680052185451030385841017087022204418055051382616302471053169370181768309768797522306381968061454511970090508880003571264680375541874397620644892178316480743877639178952899639421174415003931100029266521366987487527781801363772040088929625386302181818960608576375463235429994701417153144489481595528276358876118935361712671704273723924030863635859517540166787268451123293126738041638928465167872661962957441")
|
||||
# # number3 = Decimal("322")
|
||||
# # print((number1/number2)*number3)
|
||||
|
||||
|
||||
# def kubik(n: int) -> list:
|
||||
# a= 1<= n <= 10**5
|
||||
# data = []
|
||||
# while len(data) <n:
|
||||
# data.append(random.randint(1,6))
|
||||
# return data
|
||||
# def count_rate(kub_data: list):
|
||||
# """
|
||||
# Возвращает частоту выпадания значений кубика,
|
||||
# согласно полученным данным
|
||||
# :param kub_data: данные эксперимента
|
||||
# :return:
|
||||
# """
|
||||
# kub_rate = {}
|
||||
# for i in kub_data:
|
||||
# if i in kub_rate:
|
||||
# continue
|
||||
# else:
|
||||
# kub_rate[i] = kub_data.count(i)
|
||||
# for i in range(1, 7):
|
||||
# if i not in kub_rate:
|
||||
# kub_rate[i] = 0
|
||||
# return kub_rate
|
||||
|
||||
# from decimal import Decimal
|
||||
# number1 = Decimal("1")
|
||||
# number2 = Decimal("1243427403367201317393839301441743747728372586525670766261640905620809506005587639080279955406183542710879519297596480474251532052264053522247101137843549025799051484953585952784850325557214920862419103754250378054748361864221285507407958456970340557601822416379088854977906548248843321368085906291446155298147765800006733873921195716852574867930071563891483652506398305540218047871687996232303256042568680052185451030385841017087022204418055051382616302471053169370181768309768797522306381968061454511970090508880003571264680375541874397620644892178316480743877639178952899639421174415003931100029266521366987487527781801363772040088929625386302181818960608576375463235429994701417153144489481595528276358876118935361712671704273723924030863635859517540166787268451123293126738041638928465167872661962957441")
|
||||
# number3 = Decimal("322")
|
||||
# print(number3/number2)
|
||||
|
||||
|
||||
# number2 = 1243427403367201317393839301441743747728372586525670766261640905620809506005587639080279955406183542710879519297596480474251532052264053522247101137843549025799051484953585952784850325557214920862419103754250378054748361864221285507407958456970340557601822416379088854977906548248843321368085906291446155298147765800006733873921195716852574867930071563891483652506398305540218047871687996232303256042568680052185451030385841017087022204418055051382616302471053169370181768309768797522306381968061454511970090508880003571264680375541874397620644892178316480743877639178952899639421174415003931100029266521366987487527781801363772040088929625386302181818960608576375463235429994701417153144489481595528276358876118935361712671704273723924030863635859517540166787268451123293126738041638928465167872661962957441
|
||||
# number3 = 322
|
||||
# print(number3/number2)
|
||||
# from decimal import Decimal
|
||||
# # number1 = Decimal("1")
|
||||
# # # number2 = Decimal("1243427403367201317393839301441743747728372586525670766261640905620809506005587639080279955406183542710879519297596480474251532052264053522247101137843549025799051484953585952784850325557214920862419103754250378054748361864221285507407958456970340557601822416379088854977906548248843321368085906291446155298147765800006733873921195716852574867930071563891483652506398305540218047871687996232303256042568680052185451030385841017087022204418055051382616302471053169370181768309768797522306381968061454511970090508880003571264680375541874397620644892178316480743877639178952899639421174415003931100029266521366987487527781801363772040088929625386302181818960608576375463235429994701417153144489481595528276358876118935361712671704273723924030863635859517540166787268451123293126738041638928465167872661962957441")
|
||||
# # # number3 = Decimal("322")
|
||||
# # # print((number1/number2)*number3)
|
||||
|
||||
# def fun(n, r):
|
||||
# return n ** r
|
||||
# print(fun((1/321), 322))
|
||||
|
||||
def factorial(n):
|
||||
if n >= 1: return (0.5**(factorial(n)+1))
|
||||
if n <= 10**5: return (0.5**(factorial(n)+1))
|
||||
else: return 1
|
||||
print (factorial(3))
|
||||
|
89
drugoe/new.py
Normal file
89
drugoe/new.py
Normal file
@ -0,0 +1,89 @@
|
||||
# # # greeting = "Hello world"
|
||||
# # # greetingl = len(greeting)
|
||||
# # # print(greetingl)
|
||||
# # result = 1000/7
|
||||
# # print(result)
|
||||
# # print("The result of division is {0:10.3f}".format(result))
|
||||
# # {0:10.2f}{1:10.2f}{2:10.2f}
|
||||
# # {3:10.2f}{4:10.2f}{5:10.2f}
|
||||
# # """.format(1.5674, 3.56, 78.3434, 876.652357658
|
||||
# # number_list = [8, 2, 24]
|
||||
# # number_list.reverse()
|
||||
# # number_list.pop()
|
||||
# # print (number_list[0])
|
||||
|
||||
# # number_list.sort()
|
||||
# # number_list.pop()
|
||||
# # print (number_list[0])
|
||||
|
||||
# # print (number_list.sort())
|
||||
|
||||
# # a = input ('первое число ')
|
||||
# # b = input ('vtoroe число ')
|
||||
# # c = input ('tretye число ')
|
||||
# # a1 = int(a)
|
||||
# # b1 = int(b)
|
||||
# # c1 = int(c)
|
||||
# # number_list = [a,b,c]
|
||||
# # number_list.sort()
|
||||
# # print (number_list[2])
|
||||
# # print (number_list[0])
|
||||
# # print (number_list[1])
|
||||
|
||||
# # a = input ('chislo ')
|
||||
# # a1 = int(a)
|
||||
# # first = a[:]
|
||||
# # first1 = (first[0])
|
||||
# # first2 = (first[1])
|
||||
# # first3 = (first[2])
|
||||
# # first_int_1 = int(first1)
|
||||
# # first_int_2 = int(first2)
|
||||
# # first_int_3 = int(first3)
|
||||
# # sum_first = first_int_1 + first_int_2 + first_int_3
|
||||
# # second = a[:]
|
||||
# # second1 = (second[3])
|
||||
# # second2 = (second[4])
|
||||
# # second3 = (second[5])
|
||||
# # second_int_1 = int(second1)
|
||||
# # second_int_2 = int(second2)
|
||||
# # second_int_3 = int(second3)
|
||||
# # sum_second = second_int_1 + second_int_2 + second_int_3
|
||||
# # if sum_first == sum_second:
|
||||
# # print ("luck")
|
||||
# # else:
|
||||
# # print ("standart")
|
||||
|
||||
# # a = int(input())
|
||||
# # b = int(input())
|
||||
# # c = int(input())
|
||||
# # p = (a+b+c)/2
|
||||
# # # S = (p*(p-a)*(p-b)*(p-c))**0.5
|
||||
# # # print(S)
|
||||
|
||||
# # # 1
|
||||
# # a = int (input())
|
||||
|
||||
# # smile = '\U0001f600'
|
||||
# # print (smile)
|
||||
# # if smile == '\U0001f600':
|
||||
# # print (smile,smile)
|
||||
|
||||
# # for x in range (10)
|
||||
|
||||
# # for number in range (10):
|
||||
# # count = 0
|
||||
# # emoticons = ''
|
||||
# # while count <= number:
|
||||
# # emoticons += '\U0001f600'
|
||||
# # count += 1
|
||||
# # print (emoticons)
|
||||
|
||||
# for number in range (10):
|
||||
# emoticons = ''
|
||||
# for count in range (number + 1):
|
||||
# emoticons += '\U0001f600'
|
||||
# print (emoticons)
|
||||
|
||||
a= 1**322
|
||||
b = 321**322
|
||||
c = a/b
|
68
practica/Dispercsia.py
Normal file
68
practica/Dispercsia.py
Normal file
@ -0,0 +1,68 @@
|
||||
# ДИСПЕРСИЯ
|
||||
# list_data = [int(value) for value in input().split()]
|
||||
# n = len(list_data)
|
||||
# Sum = 0
|
||||
# for value in list_data:
|
||||
# Sum += value
|
||||
# SUm=Sum/n
|
||||
# Sum = 0
|
||||
# for value in list_data:
|
||||
# a = (value - SUm)**2
|
||||
# Sum += a
|
||||
# D = (Sum / (n - 1 ))
|
||||
# print (D)
|
||||
|
||||
# Среднеквадратичное отклонение sd
|
||||
# list_data = [int(value) for value in input().split()]
|
||||
# n = len(list_data)
|
||||
# Sum = 0
|
||||
# for value in list_data:
|
||||
# Sum += value
|
||||
# SUm=Sum/n
|
||||
# Sum = 0
|
||||
# for value in list_data:
|
||||
# a = (value - SUm)**2
|
||||
# Sum += a
|
||||
# D = (Sum / (n - 1 ))
|
||||
# sd = D ** 0.5
|
||||
# print (sd)
|
||||
|
||||
|
||||
|
||||
|
||||
# находим среднее значение
|
||||
def find_average(x):
|
||||
return sum(x) / len(x)
|
||||
|
||||
|
||||
# находим размах
|
||||
def find_range(x):
|
||||
x_copy = sorted(x)
|
||||
return abs(x_copy[-1] - x_copy[0])
|
||||
|
||||
# находим медиану
|
||||
def find_median(x):
|
||||
if len(x) % 2 == 0:
|
||||
return (x[len(x) // 2] + x[len(x) // 2 -1]) / 2
|
||||
else:
|
||||
return x[len(x) // 2]
|
||||
|
||||
# находим дисперсию в генеральной совокупности
|
||||
def find_general_variance(x, x_average):
|
||||
variance = 0
|
||||
for i in x:
|
||||
variance += (i - x_average) ** 2
|
||||
return variance / len(x)
|
||||
|
||||
|
||||
# находим дисперсию в выборке
|
||||
def find_subgeneral_variance(x, x_average):
|
||||
variance = 0
|
||||
for i in x:
|
||||
variance += (i - x_average) ** 2
|
||||
return variance / (len(x) - 1)
|
||||
|
||||
|
||||
# возвращаем квадрат из числа
|
||||
def get_sqrt(x):
|
||||
return x ** 0.5
|
18
practica/new list.py
Normal file
18
practica/new list.py
Normal file
@ -0,0 +1,18 @@
|
||||
# задача со временем, во сколько надо поставить будильник лене
|
||||
a = int(input())
|
||||
b = int(input())
|
||||
c = int(input())
|
||||
n = int(a/60)+b
|
||||
d = a % 60
|
||||
m= d+c
|
||||
if m < 60:
|
||||
print (n)
|
||||
print (m)
|
||||
else:
|
||||
print ((m // 60)+ n)
|
||||
print (m % 60)
|
||||
|
||||
|
||||
|
||||
|
||||
|
39
practica/povtorProverka.py
Normal file
39
practica/povtorProverka.py
Normal file
@ -0,0 +1,39 @@
|
||||
# format
|
||||
# float_res= 1000/7
|
||||
# print (float_res)
|
||||
# print ("The result is {0}".format(float_res))
|
||||
# print ("The result is {0:1.3f}".format(float_res))
|
||||
# print ("The result is {0:10.3f}".format(float_res))
|
||||
|
||||
# # tables вернуться к уроку и узнать как форматнуть
|
||||
# print ('''{0.10.2f} {1.10.2f} {2.10.2f}
|
||||
# {3.10.2f} {4.10.2f} {5.10.2f}
|
||||
# '''.format(3.5666, 2.53666, 3.55555, 4.55555, 5.55555, 6.55555))
|
||||
|
||||
# x1 = [ 1, 3, 1, 3, 7, 8, 9, 10, 12, 12, 13, 18, 20, 19 ]
|
||||
# x2 = [2, 6, 2, 6, 14, 16, 18, 20, 24, 24, 26, 36, 40, 38]
|
||||
# print(len(x1))
|
||||
# print(len(x2))
|
||||
# k = []
|
||||
# for i in range(14):
|
||||
# k.append(x2[i] - x1[i])
|
||||
# print(all(k[i] == x1[i] for i in range(len(x1))))
|
||||
|
||||
|
||||
'''Узнаем среднее значение выборки'''
|
||||
|
||||
# s = list(map(int, input().split()))
|
||||
# print(sum(s) / len(s))
|
||||
|
||||
# # проверка работы методов с sets
|
||||
# list = [1,3,45,68,2]
|
||||
# set_list= set(list)
|
||||
# add= set_list.add(777)
|
||||
# print(set_list)
|
||||
# clear = set_list.clear
|
||||
# print (clear)
|
||||
|
||||
list = [1,2,3,4,5]
|
||||
for numbers in list:
|
||||
print (numbers)
|
||||
print ('Hi')
|
13
practica/razobrat.py
Normal file
13
practica/razobrat.py
Normal file
@ -0,0 +1,13 @@
|
||||
import numpy as np
|
||||
from scipy import stats
|
||||
|
||||
data = input().split()
|
||||
data = np.array(data, dtype=int)
|
||||
print(data)
|
||||
|
||||
M = np.mean(data) # среднее сзначение
|
||||
mode = stats.mode(data) # мода
|
||||
median = np.median(data) # медиан
|
||||
R = np.max(data) - np.min(data) # размах
|
||||
D = np.var(data) # дисперсия
|
||||
sd = np.std(data) # стандартное отклонение
|
40
practica/ucheba.py
Normal file
40
practica/ucheba.py
Normal file
@ -0,0 +1,40 @@
|
||||
# x = 5
|
||||
# y = 10
|
||||
# print (y > x * x or y >= 2 * x and x < y)
|
||||
|
||||
|
||||
# a = True
|
||||
# b = False
|
||||
# print (a and b or not a and not b)
|
||||
|
||||
# Не выходит
|
||||
# a = int (input())
|
||||
# b = int (input())
|
||||
# h = int (input())
|
||||
# if a > 0 and a <= b and b > 0 and b < 100:
|
||||
# if h >= a and h < b:
|
||||
# print ('Это нормально')
|
||||
# elif h < a:
|
||||
# print ('Недосып')
|
||||
# elif h >= b:
|
||||
# print ('Пересып')
|
||||
|
||||
|
||||
# # високосный год
|
||||
# a = int (input())
|
||||
# if (a % 4 == 0 and a % 100 != 0):
|
||||
# print('Високосный')
|
||||
# elif a % 400 == 0:
|
||||
# print('Високосный')
|
||||
# else:
|
||||
# print ('Обычный')
|
||||
|
||||
# A = int(input())
|
||||
# B = int(input())
|
||||
# H = int(input())
|
||||
# if H >= A and H <= B:
|
||||
# print ('Это нормально')
|
||||
# elif H <= A:
|
||||
# print ('Недосып')
|
||||
# elif H >= B:
|
||||
# print ('Пересып')
|
493
practica/zadachi.py
Normal file
493
practica/zadachi.py
Normal file
@ -0,0 +1,493 @@
|
||||
# # мое решение задачи с программистами
|
||||
# n = int(input())
|
||||
# if n < 20:
|
||||
# if n == 1:
|
||||
# print (str(n) + ' программист')
|
||||
# elif n == 2 or n == 3 or n == 4:
|
||||
# print (str(n) + ' программиста')
|
||||
# else:
|
||||
# print (str(n) + ' программистов')
|
||||
# if 19 < n < 100:
|
||||
# if (int(str(n)[-1]) == 2) or (int(str(n)[-1]) == 3) or (int(str(n)[-1]) == 4):
|
||||
# print (str(n) + ' программиста')
|
||||
# elif int(str(n)[-1]) == 1:
|
||||
# print (str(n) + ' программист')
|
||||
# else:
|
||||
# print (str(n) + ' программистов')
|
||||
# if n > 99:
|
||||
# if ((((int(str(n)[-2:])) != 12) and ((int(str(n)[-1])) == 2))) or ((((int(str(n)[-2:])) != 13) and ((int(str(n)[-1])) == 3))) or ((((int(str(n)[-2:])) != 14) and ((int(str(n)[-1])) == 4))):
|
||||
# print (str(n) + ' программиста')
|
||||
# elif (int(str(n)[-1]) == 1) and (int(str(n)[-2:]) != 11):
|
||||
# print (str(n) + ' программист')
|
||||
# else:
|
||||
# print (str(n) + ' программистов')
|
||||
|
||||
# # Короткий вариант
|
||||
# i=int(input())
|
||||
# d=i%10
|
||||
# h=i%100
|
||||
# # if d==1 and h!=11:
|
||||
# # s=""
|
||||
# # elif 1<d<5 and not 11<h<15:
|
||||
# # s="а"
|
||||
# # else:
|
||||
# # s="ов"
|
||||
# # print(i," программист"+s)
|
||||
|
||||
|
||||
# # задача с интервалами
|
||||
# x = int(input())
|
||||
# print ((-15 < x <= 12) or (14 < x < 17) or (19 <= x))
|
||||
|
||||
# # # zadachya s biletom
|
||||
# bilet_num = [int(value) for value in input()]
|
||||
# Sum = 0
|
||||
# Sum2 = 0
|
||||
# for num in bilet_num:
|
||||
# Sum += (int(str(num)[0:3]))
|
||||
# print (num)
|
||||
# for num in bilet_num:
|
||||
# print (num)
|
||||
# Sum2 += (int(str(num)[3:]))
|
||||
# if Sum == Sum2:
|
||||
# print('Счастливый')
|
||||
# else:
|
||||
# print ('Обычный')
|
||||
|
||||
# # # задача с билетом
|
||||
# bilet_num = list(int(value) for value in input())
|
||||
# Sum = 0
|
||||
# Sum_1 = 0
|
||||
# for num in bilet_num[:3]:
|
||||
# Sum = Sum + num
|
||||
# for num in bilet_num[3:]:
|
||||
# Sum_1 = Sum_1 + num
|
||||
# if Sum == Sum_1:
|
||||
# print ("Счастливый")
|
||||
# else:
|
||||
# print("Обычный")
|
||||
|
||||
# i = 0
|
||||
# while i < 5:
|
||||
# print('*')
|
||||
# if i % 2 == 0:
|
||||
# print('**')
|
||||
# if i > 2:
|
||||
# print('***')
|
||||
# i = i + 1
|
||||
|
||||
# # программа, кот считывает числа с ввода и после первого введенного нуля выводит сумму полученных чисел
|
||||
# a = int(input())
|
||||
# s = a
|
||||
# while a != 0:
|
||||
# a = int(input())
|
||||
# s += a
|
||||
# print(s)
|
||||
|
||||
# a= input().split()
|
||||
# Sum = 0
|
||||
# for num in a:
|
||||
# if num == 0:
|
||||
# break
|
||||
# Sum = Sum + int(num)
|
||||
# print (Sum)
|
||||
|
||||
# Задача с пирогом и разделением по кусочкам на количесвто человек
|
||||
# a = int(input())
|
||||
# b = int(input())
|
||||
# if a!= b:
|
||||
# if a>b:
|
||||
# a -= b
|
||||
# else:
|
||||
# b -= a
|
||||
# print (a, b)
|
||||
|
||||
# НОД чисел, алгоритм Евклида
|
||||
# a = int(input())
|
||||
# b = int(input())
|
||||
# while a!=0 and b!=0:
|
||||
# if a > b:
|
||||
# a = a % b
|
||||
# else:
|
||||
# b = b % a
|
||||
# if a != 0:
|
||||
# print(a)
|
||||
# else:
|
||||
# print (b)
|
||||
|
||||
# a = int(input())
|
||||
# b = int(input())
|
||||
# while a > b:
|
||||
# if a%b==0 and a%:
|
||||
# print(a)
|
||||
# break
|
||||
# else:
|
||||
# a+=1
|
||||
# while b > a:
|
||||
# if b%a==0:
|
||||
# print(b)
|
||||
# break
|
||||
# else:
|
||||
# b+=1
|
||||
|
||||
# a = int(input())
|
||||
# b = int(input())
|
||||
# if a >b:
|
||||
# while a % b != 0:
|
||||
# a += 1
|
||||
# if a % b ==
|
||||
# else:
|
||||
# print(a)
|
||||
|
||||
# a = int(input())
|
||||
# b = int(input())
|
||||
# n = a
|
||||
# m = b
|
||||
# while a % b != 0:
|
||||
# n = a
|
||||
# n += 1
|
||||
# if n % b == 0 and n % a == 0:
|
||||
# print (n)
|
||||
# else:
|
||||
# n +=1
|
||||
|
||||
# print(a)
|
||||
|
||||
# a = int(input())
|
||||
# b = int(input())
|
||||
# # if a == b:
|
||||
# # print (a)
|
||||
# if a>b:
|
||||
# if a % b != 0:
|
||||
# n = a
|
||||
# while a % b != 0:
|
||||
# a += 1
|
||||
# if a % b == 0:
|
||||
# if a%n == 0:
|
||||
# else:
|
||||
# print (a)
|
||||
|
||||
|
||||
# a = int(input())
|
||||
# b = int(input())
|
||||
# if a == b:
|
||||
# print (a)
|
||||
# if a>b:
|
||||
# if a % b != 0:
|
||||
# n = a
|
||||
# while a % b != 0:
|
||||
# a += 1
|
||||
# if a % b == 0:
|
||||
# if a%n != 0:
|
||||
# a +=1
|
||||
# else:
|
||||
# print (a)
|
||||
# else:
|
||||
# print (a)
|
||||
# if b>a:
|
||||
# if b % a != 0:
|
||||
# m = b
|
||||
# while b % a != 0:
|
||||
# b += 1
|
||||
# if b % a == 0:
|
||||
# if b%m != 0:
|
||||
# b +=1
|
||||
# else:
|
||||
# print (b)
|
||||
# else:
|
||||
# print (b)
|
||||
|
||||
# a=int(input())
|
||||
# b=int(input())
|
||||
# n=a
|
||||
# if a==b: # если оба значения (a и b) равны, выводим сразу это значение, и программа завершается.
|
||||
# print(n)
|
||||
# # иначе, при помощи цикла, прибавляем к одному из значений(a или b) его же значение,
|
||||
# else: # а+а+... или b+b+...до тех пор, пока сумма не будет кратной введенным значениям a и b
|
||||
# while n%a!=0 or n%b!=0: # ТАКОЙ способ позволяет не прерывать цикл. Ниже пояснение.
|
||||
# n=n+a
|
||||
# print(n)
|
||||
|
||||
# else:
|
||||
# print(a)
|
||||
# if b>a:
|
||||
# if b % a != 0:
|
||||
# while m % a != 0 and m % b != 0:
|
||||
# m += 1
|
||||
# print (m)
|
||||
# else:
|
||||
# print(m)
|
||||
|
||||
|
||||
# i = input().splitlines()
|
||||
# for num in i:
|
||||
# print (num)
|
||||
# while num > 10:
|
||||
# if num < 100:
|
||||
# continue
|
||||
# if num > 100:
|
||||
# break
|
||||
|
||||
|
||||
# по 1 числу в строке\ если меньше 10 то пропускаем/ если число больше 100 то стоп/ остальное вывести
|
||||
# i=0
|
||||
# while i <= 100:
|
||||
# i = int(input())
|
||||
# if i < 10:
|
||||
# continue
|
||||
# if i>100:
|
||||
# break
|
||||
# else:
|
||||
# print(i)
|
||||
|
||||
|
||||
# for j in range(1):
|
||||
# print ("c", end="v")
|
||||
|
||||
# # таблица умножения в виде таблицы
|
||||
# a = int(input())
|
||||
# b = int(input())
|
||||
# c = int(input())
|
||||
# d = int(input())
|
||||
# for num in range (c,d+1):
|
||||
# print("\t"+ str(num), end="")
|
||||
# print()
|
||||
# for num in range (a, b+1):
|
||||
# print (num,end="\t")
|
||||
# for num_2 in range (c, d+1):
|
||||
# print(num * num_2, end="\t")
|
||||
# print()
|
||||
|
||||
# a = int(input())
|
||||
# b = int(input())
|
||||
# c = int(input())
|
||||
# d = int(input())
|
||||
# for num in range (c,d+1):
|
||||
# # # print ('\t' + str(num), end="\t")
|
||||
# # # print ("\t",str(num), sep='\t')
|
||||
# print("\t" + str(num), end="")
|
||||
|
||||
# print()
|
||||
|
||||
# for num in range (a, b+1):
|
||||
# print (num,end="\t")
|
||||
# for num_2 in range (c, d+1):
|
||||
# # # # print (num_1)
|
||||
# # # m= int(num_1) * c
|
||||
# # # # print (m)
|
||||
# # # n= int(num_1) * d
|
||||
# # # # print (n)
|
||||
# # # if m == n:
|
||||
# # # print (str(num_1),str(m), sep ='\t')
|
||||
# # # else:
|
||||
# print(num * num_2, end="\t")
|
||||
# print()
|
||||
|
||||
# # print (num_1 + m,n,end ="\t")
|
||||
# # + (m) + (n))
|
||||
|
||||
# a, b, c, d = int(input()), int(input()), int(input()), int(input())
|
||||
|
||||
# for i in range(c, d + 1):
|
||||
# print("\t" + str(i), end="")
|
||||
|
||||
# print()
|
||||
|
||||
# for i in range(a, b + 1):
|
||||
# print(i, end="\t")
|
||||
# for n in range(c, d + 1):
|
||||
# print(i * n, end="\t")
|
||||
# print()
|
||||
|
||||
# # задача с четностью для 3
|
||||
# a,b = (int(i) for i in input().split())
|
||||
# # a = (int(input()))
|
||||
# # b = (int(input()))
|
||||
# S = 0
|
||||
# len=0
|
||||
# # len_range= len(range(a,b)) + 1
|
||||
# for i in range (a, b+1):
|
||||
# if i%3==0:
|
||||
# S += i
|
||||
# len+=1
|
||||
# μ = S / len
|
||||
# print(μ)
|
||||
|
||||
|
||||
# # процентное соотношение
|
||||
# S = input().lower()
|
||||
# print (S)
|
||||
# g = S.count("g")
|
||||
# print (g)
|
||||
# c = S.count("c")
|
||||
# print (g)
|
||||
# print (((int(g)+int(c))/len(S))*100)
|
||||
|
||||
# s = 'abcdefghijk'
|
||||
# m = s[3:6]
|
||||
# print (m)
|
||||
# m = s[:6]
|
||||
# print (m)
|
||||
# m = s[3:]
|
||||
# print (m)
|
||||
# m = s[::-1]
|
||||
# print (m)
|
||||
# m = s[-3:]
|
||||
# print (m)
|
||||
# m = s[:-6]
|
||||
# print (m)
|
||||
# m = s[-1:-10:-2]
|
||||
# print (m)
|
||||
|
||||
#учет символов в строке
|
||||
# str = input()
|
||||
# ind = 0
|
||||
# ls =0
|
||||
# for l in str:
|
||||
# # n = str[0]
|
||||
# # if l == n:
|
||||
# # ls += 1
|
||||
# # else:
|
||||
# # n = str[(ls-1)]
|
||||
# n=l
|
||||
# if n == l:
|
||||
# ind +=1
|
||||
# if n!= l:\
|
||||
# str = input()
|
||||
# ls=0
|
||||
# # for l in str:
|
||||
# # letter_index= letter_index +1
|
||||
# # for index,letter in enumerate(str):
|
||||
# # # print (letter)
|
||||
# # # print (index)
|
||||
# for letter in str:
|
||||
# i = str[0]
|
||||
# if letter == i:
|
||||
# ls = ls+1
|
||||
# else:
|
||||
# lm = ls - 1
|
||||
|
||||
|
||||
# # print (i)
|
||||
# print (ls-1)
|
||||
|
||||
|
||||
# students = ['Ivan', 'Masha', 'Sasha']
|
||||
# students += ['Olga']
|
||||
# students += 'Olga'
|
||||
# print (students)
|
||||
|
||||
# a = [1, 2, 3]
|
||||
# b = a
|
||||
# print (b)
|
||||
# a[1] = 10
|
||||
# print (b)
|
||||
# b[0] = 20
|
||||
# print (b)
|
||||
# print (a)
|
||||
# a = [5, 6]
|
||||
# print (b)
|
||||
# print (a)
|
||||
|
||||
# S= 0
|
||||
# # for i in range(len(a)+1):
|
||||
# for i in input().split():
|
||||
# i = int(i)
|
||||
# S += i
|
||||
# # print(S)
|
||||
# print(S)
|
||||
|
||||
|
||||
# a = input().split()
|
||||
# len_a = len(a) - 1
|
||||
# for index, number in enumerate(a):
|
||||
# if len_a == 0:
|
||||
# print (number)
|
||||
# else:
|
||||
# if index == 0:
|
||||
# S = int(a[-1]) + int(a[1])
|
||||
# b = str(S)
|
||||
# elif index != 0 and index != int(len_a) :
|
||||
# n_index_0 = int(int(a.index(number)) + 1)
|
||||
# n_index_2 = int(int(a.index(number)) - 1)
|
||||
# n_0 = a[n_index_0]
|
||||
# N_2 = a[n_index_2]
|
||||
# S1 = int(n_0) + int(N_2)
|
||||
# b += " " + str(S1)
|
||||
# elif index == int(len_a):
|
||||
# S2 = int(a[0]) + int(a[-2])
|
||||
# b += " " + str(S2)
|
||||
# print (b)
|
||||
# x = [int(m) for m in str(b)]
|
||||
# print (x) в список
|
||||
# print (" ".join(b))
|
||||
|
||||
# initial_list = input().split()
|
||||
# sum_list = []
|
||||
# left_index = -1
|
||||
# right_index = -len(initial_list) + 1
|
||||
# middle_index = 0
|
||||
# while middle_index < len(initial_list):
|
||||
# sum_list.append(initial_list[left_index] + initial_list[right_index])
|
||||
# left_index += 1
|
||||
# right_index += 1
|
||||
# middle_index += 1
|
||||
# print(sum_list)
|
||||
|
||||
|
||||
# a = [int(item) for item in input().split()]
|
||||
# a2 = []
|
||||
# for i in range(len(a)):
|
||||
# if len(a) == 1:
|
||||
# print(a[0])
|
||||
# break
|
||||
# else:
|
||||
# if i == 0:
|
||||
# a2.append(a[-1] + a[i + 1])
|
||||
# elif i > 0 and i != len(a) - 1:
|
||||
# a2.append(a[i - 1] + a[i + 1])
|
||||
# else:
|
||||
# a2.append(a[i - 1] + a[0])
|
||||
# if a2 != 0:
|
||||
# for i in a2:
|
||||
# print(i, end=' ')
|
||||
|
||||
# a = input().split()
|
||||
# a_sorted= a.sort()
|
||||
# int=0
|
||||
# for i, item in enumerate(a):
|
||||
# if len(a) == 1:
|
||||
# None
|
||||
# else:
|
||||
# # if a [i] == a [i+1]:
|
||||
# n =
|
||||
|
||||
# a = input().split()
|
||||
# a2 = []
|
||||
# for item in a:
|
||||
# c = a.count(item)
|
||||
# if c > 1:
|
||||
# a2.append(item)
|
||||
# if c == 1:
|
||||
# None
|
||||
# def del_dubl(a2):
|
||||
# seen = set()
|
||||
# seen_add = seen.add
|
||||
# return [x for x in a2 if not (x in seen or seen_add(x))]
|
||||
# for i in del_dubl(a2):
|
||||
# print(i, end=' ')
|
||||
|
||||
# удаление дубликатов
|
||||
# a = input().split()
|
||||
# def del_dubl(a):
|
||||
# seen = set()
|
||||
# seen_add = seen.add
|
||||
# return [x for x in a if not (x in seen or seen_add(x))]
|
||||
# print (del_dubl(a))
|
||||
|
||||
n =3
|
||||
a = [[0]*n]*n
|
||||
a[0][0]= 5
|
||||
print (a)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user