diff --git a/cat lesson01_normal_2.py b/cat lesson01_normal_2.py new file mode 100644 index 0000000..1921e97 --- /dev/null +++ b/cat lesson01_normal_2.py @@ -0,0 +1,12 @@ +_author_='Olga_Strelenko' + +#Задание2 + +answer = input('Введите данные ' ) +answer1 = input('Введите данные1 ' ) + +answer,answer1 = answer1,answer + +number= (answer,answer1) +print(number [0]) +print(number [1]) diff --git a/lesson01_easy.py b/lesson01_easy.py new file mode 100644 index 0000000..183aec7 --- /dev/null +++ b/lesson01_easy.py @@ -0,0 +1,25 @@ +_author_='Olga_Strelenko' + +#Задача1 + +number = int(input(' Введите число ')) +for i in str(number): + print(i) + +#Задача2 + +answer_user= input('Введите данные ' ) +answer_user1= input('Введите данные1 ') +answer_change = '' +answer_change = answer_user +answer_user=answer_user1 +answer_user1= answer_change +print(answer_user, answer_user1) + + +#Задача3 +age=int(input('Введите свой возраст ')) +if age >= 18: + print('Доступ разрешен') +else: + print('Извините, пользование данным ресурсом только с 18 лет') diff --git a/lesson01_hard.py b/lesson01_hard.py new file mode 100644 index 0000000..931fe87 --- /dev/null +++ b/lesson01_hard.py @@ -0,0 +1,10 @@ +#Заданиеhard +a = float("inf") +if a== a**2: + print(True) +if a== a*2: + print(True) +if a > 999999: + print(True) + +print(a) diff --git a/lesson01_normal_1.py b/lesson01_normal_1.py new file mode 100644 index 0000000..a90c0a2 --- /dev/null +++ b/lesson01_normal_1.py @@ -0,0 +1,6 @@ +_author_='Olga_Strelenko' + +#normal +#Задание1 +number = input('Введите число ') +print(max(number)) diff --git a/lesson01_normal_3.py b/lesson01_normal_3.py new file mode 100644 index 0000000..4d39789 --- /dev/null +++ b/lesson01_normal_3.py @@ -0,0 +1,21 @@ +_author_='Olga_Strelenko' + +#задание3 + +print("Введите коэффициенты для квадратного уравнения (ax^2 + bx + c = 0):") +a = float(input("a = ")) +b = float(input("b = ")) +c = float(input("c = ")) + +discr = b**2 - 4 * a * c; +print("Дискриминант D = %.2f" % discr) +if discr > 0: + import math + x1 = (-b + math.sqrt(discr)) / (2 * a) + x2 = (-b - math.sqrt(discr)) / (2 * a) + print("x1 = %.2f \nx2 = %.2f" % (x1, x2)) +elif discr == 0: + x = -b / (2 * a) + print("x = %.2f" % x) +else: + print("Корней нет")