Compare commits

...

11 Commits

Author SHA1 Message Date
6b5111ff98 add condition for the mathematical tasks 2023-10-06 22:51:27 +03:00
7d9e3c75ed add fix to task 2023-10-06 22:48:22 +03:00
39f0344e2c add fix to task 2023-10-06 22:47:52 +03:00
e12d528884 some fix in taskk 2023-10-06 22:42:17 +03:00
c255016913 some fix in taskk 2023-10-06 22:40:49 +03:00
b2cdae5b38 add new task 2023-10-06 22:35:53 +03:00
6c7b578bbc add new task 2023-10-06 22:16:25 +03:00
4f52a7a322 add new task 2023-10-06 22:16:09 +03:00
73dcb93f67 add new task to .stepik_tasks 2023-10-06 22:15:27 +03:00
20c90b023c add new tasks to the file 2023-10-06 22:05:26 +03:00
f61072a605 add some description of the points 2023-10-06 22:00:19 +03:00
8 changed files with 129 additions and 45 deletions

View File

@ -2,22 +2,27 @@
Here you can find different tasks.
Among them there are:
---
- [Math tasks](math) - useful programs, functions and ready-made solutions for various mathematical operations
- **[Math tasks](math)** - useful programs, functions and ready-made solutions for various mathematical operations
- [Ordinary tasks](math/ord_tasks) - task shich i did for myself
- [Statistic tasks](math/statistic) - statistic tasks, which can be usefull in econometric calculations
- [Course tasks](stepik)
- [Beneficial features](stepik/beneficial_features)
- [Dictionaries and lists](stepik/beneficial_features/dictionaries_and_lists.py)
- [Double](stepik/beneficial_features/double.py)
- [Indentation](stepik/beneficial_features/indentation.py)
- [Index](stepik/beneficial_features/index.py)
- [Input](stepik/beneficial_features/input.py)
- [Sketches](stepik/sketches)
- [Sketches](stepik/sketches/input.py)
- [Stepik tasks](stepik/stepik_tasks)
- [10_pass_100_break](stepik/stepik_tasks/10_pass_100_break.py)
- [counting_numbers](stepik/stepik_tasks/counting_numbers.py )
---
- **[Course tasks](stepik)** - different tasks from various courses
- ***[Beneficial features](stepik/beneficial_features)*** - beneficial features which you can use for mathematic and statistic tasks
- [Dictionaries and lists](stepik/beneficial_features/dictionaries_and_lists.py) - some of the properties of dictionaries and lists
- [Double](stepik/beneficial_features/double.py) - how to find/delete double numbers/letters on a input line
- [Indentation](stepik/beneficial_features/indentation.py) - some of features to do indentation
- [Index](stepik/beneficial_features/index.py) - some of features of index
- [Input](stepik/beneficial_features/input.py) - some of features of input. function
---
- ***[Sketches](stepik/sketches)*** - here you can find various of sketches unfinished\ unsuitable project
- [Sketches](stepik/sketches/input.py) - there are fail code here
---
- ***[Stepik tasks](stepik/stepik_tasks)*** - here you can find done tasks from stepik courses. Details here: **[README](stepik/stepik_tasks/README.md)**
- [10_pass_100_break](stepik/stepik_tasks/10_pass_100_break.py)
- [counting_numbers](stepik/stepik_tasks/counting_numbers.py)
- [Geometric figures](stepik/stepik_tasks/geometric_figures.py)
- [intervals](stepik/stepik_tasks/intervals.py )
- [percentage_of_letters](stepik/stepik_tasks/percentage_of_letters.py)
- [Pie](stepik/stepik_tasks/pie.py)
@ -25,7 +30,6 @@ Among them there are:
- [sum_num_from_last](stepik/stepik_tasks/sum_num_from_last.py)
- [sum_num_nearby](stepik/stepik_tasks/sum_num_nearby.py)
- [Tickets](stepik/stepik_tasks/tickets.py)

View File

@ -0,0 +1,40 @@
# Stepik tasks
Here you can find done tasks from stepik courses.
- [10_pass_100_break](10_pass_100_break.py)
For each entered number, check: if the number is less than 10, then pass this number;
if the number is greater than 100, then break;in other cases, print this number back to the console in a separate line.
- [Counting_numbers](counting_numbers.py)
A program that reads numbers from input and after the first zero entered, prints the sum of the received numbers
- [Intervals](intervals.py)
Write a program that takes an integer as input and prints True if the passed value falls within the interval (15,12](14,17)[19,+∞) and False otherwise (case matters)
- [Percentage of letters](percentage_of_letters.py)
- #1 Write a program that calculates the percentage of characters G (guanine) and C (cytosine) in an input string (the program should not be case sensitive)
- #2 Write a program that reads a string, encodes it using the proposed algorithm, and prints the encoded sequence to standard output. Encoding must be case sensitive
- [Pie](pie.py)
Determine the area of the figure using the following input data:
1) **triangle**, a, b, c - lengths of the sides of the figure
2) **rectangle**, a, b - lengths of the sides of the figure
3) **circle**, r - radius of the circle
- [Programmer's names](programmer_names.py)
> Peculiarities of word endings in Russian, therefore the task is duplicated in Russian
| English ver | Russian ver |
|:-------------|:---------------|
|Write a program that reads an integer from user inputn (non-negative), outputting this number to the console along with the word "programmer" correctly modified so that the robot can communicate normally with people, for example: 1 programmer, 2 programmers, 5 programmers| Напишите программу, считывающую с пользовательского ввода целое число n (неотрицательное), выводящее это число в консоль вместе с правильным образом изменённым словом "программист", для того, чтобы робот мог нормально общаться с людьми, например: 1 программист, 2 программиста, 5 программистов|
- [Sum_num_from_last](sum_num_from_last.py)
A program that takes the left and right character from each character and combines them into one number. For the first and last numbers, the left and right numbers are the last and first numbers respectively
- [Sum_num_nearby](sum_num_nearby.py)
A program that displays the sum of the right and left numbers from the main one. For the first and last numbers, the left and right numbers are the last and first numbers respectively
- [Tickets](tickets.py)
A program that issues a “Lucky” or "regular" ticket, the number of which we entered. If all the numbers are the same - the ticket is lucky

View File

@ -0,0 +1,16 @@
# Определить площадь фигуры по сторонам и другим показателям
num= input()
if num == "треугольник":
a= int(input())
b= int(input())
c= int(input())
p= (a+b+c) / 2
print((p*(p-a)*(p-b)*(p-c))**0.5)
if num == "прямоугольник":
aa= float(input())
bb= float(input())
print(aa*bb)
if num == "круг":
n= 3.14
r= float(input())
print(n*(r**2))

View File

@ -1,4 +1,3 @@
# задача с интервалами
x = int(input())
print ((-15 < x <= 12) or (14 < x < 17) or (19 <= x))

View File

@ -1,8 +1,31 @@
# процентное соотношение букв в строке
S = input().lower()
print (S)
# print (S)
g = S.count("g")
print (g)
# print (g)
c = S.count("c")
print (g)
print (((int(g)+int(c))/len(S))*100)
# print (g)
print (((int(g)+int(c))/len(S))*100)
# то же, но написать сколько встречается букв
s = str(input())
l = len(s)-1
c = 1
t = ''
if len(s)==1:
t = t +s+str(c)
else:
for i in range(0,l):
if s[i]==s[i+1]:
c +=1
elif s[i]!=s[i+1]:
t = t + s[i]+str(c)
c = 1
for j in range(l,l+1):
if s[-1]==s[-2]:
t = t +s[j]+str(c)
elif s[-1]!=s[-2]:
t = t +s[j]+str(c)
c = 1
print(t)

View File

@ -1,12 +1,12 @@
# # начиная с конца обьединяет элементы между собой
# 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)
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)

View File

@ -1,4 +1,4 @@
# вариант решения 1
# ver 1/ вариант решения 1
a = input().split()
len_a = len(a) - 1
for index, number in enumerate(a):
@ -21,7 +21,7 @@ for index, number in enumerate(a):
print (b)
# вариант решения 2 -короче
# ver 2/ вариант решения 2 -короче
initial_list = input().split()
sum_list = []
left_index = -1
@ -34,7 +34,7 @@ while middle_index < len(initial_list):
middle_index += 1
print(sum_list)
# вариант решения 3
# ver 3/ вариант решения 3
a = [int(item) for item in input().split()]
a2 = []
for i in range(len(a)):

View File

@ -1,4 +1,17 @@
# #zadachya s biletom
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("Обычный")
# другой вариант / задача с билетом
bilet_num = [int(value) for value in input()]
Sum = 0
Sum2 = 0
@ -13,15 +26,4 @@ for num in bilet_num:
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("Обычный")