This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Кержакова рпо-24/2 | |
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
#define task_10 | |
#ifdef task_3 | |
int main(){ | |
double calories_min = 3.6; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Кержакова рпо-24/2 | |
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
#define task_9 | |
#ifdef task_1 | |
int main(){ | |
int n; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Кержакова рпо-24/2 | |
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
#define task_18 | |
#ifdef task_1 | |
int main(){ | |
double a, b, S, P; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# def triangle(symb='*', h=5): | |
# for i in range(1, h + 1): | |
# print(''* (h-1) + symb * i) | |
# for i in range(h-1, 0, -1): | |
# print(''* (h-1) + symb * i) | |
# triangle() | |
def indexs(n: int) -> list: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open('numbers.txt') as file: | |
content = list(map(int, file.read().split())) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open('test2.txt', 'w') as file: | |
# при открытии файла на запись его содержимое удаляется | |
file.write('hello') | |
print(1, 4, 5, 6, sep='\n', end='end', file=file) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = open('test2.txt', 'rt', encoding='UTF-8') | |
# # print(file) | |
# # пробежаться по элементам | |
# words = [] | |
# for i in file: | |
# words.append(i) | |
# print(words) | |
text = file.read() | |
print(text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def get_articles() -> dict: | |
with open('articles.json', 'r', encoding='UTF-8') as file: | |
data = json.load(file) | |
return data | |
def save_article(name, text): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 | |
a = list(input()) | |
print(a) | |
#2 | |
list = [1, 3, 4, 5, 6] | |
power = sum([number for number in list]); print(power) | |
#3 | |
list = [1, 2, 333, 77, 22, 9] | |
list.sort() | |
print(list[-1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# numbers = [16, 1, 15, 50, 82]; print(*numbers) | |
# numbers2 = list(input('Введите кол-во эл-ы списка: ')); print(numbers2) | |
# # for element in numbers: | |
# # print(element, end=' ') | |
# for index in range(len(numbers)): | |
# print(numbers[index], end=' ') | |
# numbers.append(7); print(numbers) | |
# numbers.insert(2, 0); print(numbers) |
NewerOlder