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
| using System.Text; | |
| // Instagram v.0.01 | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| Console.OutputEncoding = Encoding.UTF8; |
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. створення списку | |
| numbers = [10, 20, 30, 40, 50] | |
| print("Початковий список:", numbers) | |
| # 2. додавання елементів | |
| # append() — додає один елемент в кінець списку | |
| numbers.append(60) | |
| print("Після append(60):", numbers) | |
| # extend() — додає елементи з іншого списку в кінець поточного списку |
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 random | |
| import time | |
| # розмір списку | |
| size = 50000 | |
| # список цілих чисел | |
| ar = [random.randint(0, 9999) for _ in range(size)] | |
| # виведення списку |
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
| # вбудовані функції: https://docs.python.org/uk/3.9/library/functions.html | |
| text = "Hello" | |
| print(len(text)) # 5 - повертає кількість елементів в об'єкті | |
| print(type(text)) # <class 'str'> - повертає тип об'єкта | |
| print(id(text)) # 2237317883936 - повертає унікальний ідентифікатор об'єкта | |
| a = 5 | |
| b = a | |
| print(id(a)) # 140710135260200 |
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. Функції як об'єкти першого класу | |
| # У Python функції можуть бути присвоєні змінним, передаватися як аргументи | |
| # іншим функціям або навіть повертатися з функцій | |
| def say_hello(): | |
| print("Hello!") | |
| greeting = say_hello # функція присвоєна змінній | |
| greeting() # виклик функції через змінну |
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
| USE [master] | |
| GO | |
| /****** Object: Database [Store] Script Date: 13.01.2025 16:25:42 ******/ | |
| CREATE DATABASE [Store] | |
| CONTAINMENT = NONE | |
| ON PRIMARY | |
| ( NAME = N'Store', FILENAME = N'C:\1\Store.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ) | |
| LOG ON | |
| ( NAME = N'Store_log', FILENAME = N'C:\1\Store_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB ) | |
| WITH CATALOG_COLLATION = DATABASE_DEFAULT, LEDGER = OFF |
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
| #include <iostream> | |
| #include <string> | |
| #include <windows.h> | |
| using namespace std; | |
| int main() { | |
| SetConsoleOutputCP(1251); | |
| string choice; | |
| cout << "Вітаємо в текстовому квесті! Ти стоїш перед великими воротами замку.\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
| using Microsoft.Data.SqlClient; | |
| using ConsoleTableExt; // !!! dotnet add package ConsoleTableExt (NuGet) | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| Console.Title = "Вибірка даних з JOIN"; | |
| Console.OutputEncoding = System.Text.Encoding.UTF8; |
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
| using System.Data; | |
| using Microsoft.Data.SqlClient; | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| Console.OutputEncoding = System.Text.Encoding.UTF8; | |
| string connectionString = "Server=localhost; Database=Store; Integrated Security=True; TrustServerCertificate=True;"; |
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
| using System.Data; | |
| using Microsoft.Data.SqlClient; | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| Console.OutputEncoding = System.Text.Encoding.UTF8; | |
| // запитуємо у користувача дані для підключення до БД (небезпечно зберігати в коді!) |