├── .gitignore ├── Lab07 ├── README.md └── images │ └── mickeyclock.jpeg ├── Lab08 └── README.md ├── Lab09 └── README.md ├── Lab1 └── README.md ├── Lab10 └── README.md ├── Lab11 └── README.md ├── Lab2 └── README.md ├── Lab3 ├── README.md ├── classes.md ├── functions1.md └── functions2.md ├── Lab4 ├── README.md ├── date.md ├── generators.md ├── json │ ├── README.md │ └── sample-data.json └── math.md ├── Lab5 ├── README.md ├── regex.md └── row.txt ├── Lab6 ├── README.md ├── builtin-functions.md └── dir-and-files.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /Lab07/README.md: -------------------------------------------------------------------------------- 1 | ## Lab 7 2 | 3 | Learn tutorial: https://nerdparadise.com/programming/pygame: 4 | * Getting Started 5 | * Working with Images 6 | * Music and Sound Effects 7 | * Geometric Drawing 8 | * Fonts and Text 9 | * More on Input 10 | 11 | 1. Create a simple clock application (only with minutes and seconds) which is synchronized with system clock. Use Mickey's right hand as minutes arrow and left - as seconds. For moving Mickey's hands you can use: 12 | ```pygame.transform.rotate``` 13 | more explanation: https://stackoverflow.com/a/54714144 14 | 15 | 16 | mickeyclock 17 | 2. Create music player with keyboard controller. You have to be able to press keyboard: play, stop, next and previous as some keys. Player has to react to the given command appropriately. 18 | 3. Draw circle - a red ball of size 50 x 50 (radius = 25) on white background. When user presses Up, Down, Left, Right arrow keys on keyboard, the ball should move by 20 pixels in the direction of pressed key. The ball should not leave the screen, i.e. user input that leads the ball to leave of the screen should be ignored 19 | -------------------------------------------------------------------------------- /Lab07/images/mickeyclock.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beisenbek/programming-principles-2/41a5617c80164838c7a62a06a8134a3327fb97ef/Lab07/images/mickeyclock.jpeg -------------------------------------------------------------------------------- /Lab08/README.md: -------------------------------------------------------------------------------- 1 | ## Lab 8 2 | 3 | ### 1. Racer 4 | Extend example project from lecture and finish following tutorials: 5 | * https://coderslegacy.com/python/python-pygame-tutorial/ 6 | * https://coderslegacy.com/python/pygame-tutorial-part-2/ 7 | * https://coderslegacy.com/python/pygame-tutorial-part-3/ 8 | 9 | Extra tasks to the given tutorial: 10 | 1. Adding randomly appearing coins on the road 11 | 2. Showing the number of collected coins in the top right corner 12 | 6. Comment your code 13 | 14 | ### 2. Snake 15 | Extend example project from lecture and add the following functionality: 16 | 1. Checking for border (wall) collision and whether the snake is leaving the playing area 17 | 2. Generate random position for food, so that it does not fall on a wall or a snake 18 | 3. Add levels. For example, when the snake receives 3-4 foods or depending on score  19 | 5. Increase speed when the user passes to the next level 20 | 6. Add counter to score and level 21 | 6. Comment your code 22 | 23 | 24 | ### 3 Paint. 25 | Extend example project from https://nerdparadise.com/programming/pygame/part6 and add the following functionality: 26 | 1. Draw rectangle 27 | 2. Draw circle 28 | 3. Eraser 29 | 4. Color selection 30 | -------------------------------------------------------------------------------- /Lab09/README.md: -------------------------------------------------------------------------------- 1 | ## Lab 9 2 | 3 | ### 1. Racer 4 | Extend example project from Lab 8 and add following tasks: 5 | Extra tasks to the given tutorial: 6 | 1. Randomly generating coins with different weights on the road 7 | 2. Increase the speed of Enemy when the player earns `N` coins 8 | 3. Comment your code 9 | 10 | ### 2. Snake 11 | Extend example project from Lab 8 and add following tasks: 12 | 1. Randomly generating food with different weights 13 | 2. Foods which are disappearing after some time(timer) 14 | 3. Comment your code 15 | 16 | ### 3 Paint. 17 | Extend example project from Lab 8 and add following tasks: 18 | 1. Draw square 19 | 2. Draw right triangle 20 | 3. Draw equilateral triangle 21 | 4. Draw rhombus 22 | 5. Comment your code 23 | -------------------------------------------------------------------------------- /Lab1/README.md: -------------------------------------------------------------------------------- 1 | ## Lab 1 2 | 3 | 1. install git to local PC https://git-scm.com/download/win 4 | 2. register in github https://github.com/ 5 | 3. solve 13 topics from githowto https://githowto.com/ru 6 | 4. read and make exercises from w3school from: HOME to Python Strings. https://www.w3schools.com/python/default.asp 7 | 5. all examples from articles save to your github account before deadline 8 | 9 | -------------------------------------------------------------------------------- /Lab10/README.md: -------------------------------------------------------------------------------- 1 | ## Lab 10 2 | 3 | ### 1. Based on PostgreSQL tutorial https://www.postgresqltutorial.com/postgresql-python/ create PhoneBook: 4 | 5 | 1. Design tables for PhoneBook. 6 | 2. Implement two ways of inserting data into the PhoneBook. 7 | * upload data from csv file 8 | * entering user name, phone from console 9 | 4. Implement updating data in the table (change user first name or phone) 10 | 5. Querying data from the tables (with different filters) 11 | 6. Implement deleting data from tables by username of phone 12 | 13 | 14 | 15 | ### 2. User and his score in snake game. 16 | 1. Create user and user_score tables. 17 | 2. Before starting snake game, user should enter his username 18 | 3. If user exists, you should show current level of user. (You should create several levels, with different walls, speed etc.) 19 | 4. Implement shortcut for pause and save your current state and score to database. 20 | -------------------------------------------------------------------------------- /Lab11/README.md: -------------------------------------------------------------------------------- 1 | ## Lab 11 2 | 3 | ### 1. Based on previous task 'PhoneBook' implement following, using functions and stored procedures: 4 | 1. Function that returns all records based on a pattern (example of pattern: part of name, surname, phone number) 5 | 2. Create procedure to insert new user by name and phone, update phone if user already exists 6 | 3. Create procedure to insert many new users by list of name and phone. Use loop and if statement in stored procedure. Check correctness of phone in procedure and return all incorrect data. 7 | 4. Create function to querying data from the tables with pagination (by limit and offset) 8 | 5. Implement procedure to deleting data from tables by username or phone 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Lab2/README.md: -------------------------------------------------------------------------------- 1 | ## Lab 2 2 | 3 | 1. read and make exercises from w3school from Boolean to For loops inclusive. https://www.w3schools.com/python/default.asp 4 | 2. all examples from articles save to your github account before deadline 5 | 6 | -------------------------------------------------------------------------------- /Lab3/README.md: -------------------------------------------------------------------------------- 1 | ## Lab 3 2 | 3 | ### Topics covered in this lab work 4 | 5 | 1. Python Functions 6 | 2. Python Lambda 7 | 3. Python Classes and Objects. 8 | 4. Python Inheritance -------------------------------------------------------------------------------- /Lab3/classes.md: -------------------------------------------------------------------------------- 1 | ## Python Classes 2 | 3 | 1. Define a class which has at least two methods: 4 | `getString`: to get a string from console input 5 | `printString`: to print the string in upper case. 6 | 7 | 2. Define a class named `Shape` and its subclass `Square`. The `Square` class has an `init` function which takes a `length` as argument. Both classes have a `area` function which can print the area of the shape where Shape's area is 0 by default. 8 | 9 | 3. Define a class named `Rectangle` which inherits from `Shape` class from task 2. Class instance can be constructed by a `length` and `width`. The `Rectangle` class has a method which can compute the `area`. 10 | 11 | 4. Write the definition of a Point class. Objects from this class should have a 12 | - a method `show` to display the coordinates of the point 13 | - a method `move` to change these coordinates 14 | - a method `dist` that computes the distance between 2 points 15 | 16 | 5. Create a bank account class that has attributes `owner`, `balance` and two methods `deposit` and `withdraw`. Withdrawals may not exceed the available balance. Instantiate your class, make several deposits and withdrawals, and test to make sure the account can't be overdrawn. 17 | ```python 18 | class Account: 19 | pass 20 | ``` 21 | 22 | 6. Write a program which can filter prime numbers in a list by using `filter` function. 23 | Note: Use `lambda` to define anonymous functions. 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Lab3/functions1.md: -------------------------------------------------------------------------------- 1 | ## Python Function 2 | 3 | 1. A recipe you are reading states how many grams you need for the ingredient. Unfortunately, your store only sells items in ounces. Create a function to convert grams to ounces. 4 | `ounces = 28.3495231 * grams` 5 | 6 | 2. Read in a Fahrenheit temperature. Calculate and display the equivalent centigrade temperature. The following formula is used for the conversion: 7 | `C = (5 / 9) * (F – 32)` 8 | 9 | 3. Write a program to solve a classic puzzle: 10 | We count 35 heads and 94 legs among the chickens and rabbits in a farm. How many rabbits and how many chickens do we have? 11 | `create function: solve(numheads, numlegs):` 12 | 13 | 4. You are given list of numbers separated by spaces. Write a function `filter_prime` which will take list of numbers as an agrument and returns only prime numbers from the list. 14 | 15 | 5. Write a function that accepts string from user and print all permutations of that string. 16 | 17 | 6. Write a function that accepts string from user, return a sentence with the words reversed. 18 | `We are ready -> ready are We` 19 | 20 | 7. Given a list of ints, return True if the array contains a 3 next to a 3 somewhere. 21 | ```python 22 | def has_33(nums): 23 | pass 24 | 25 | has_33([1, 3, 3]) → True 26 | has_33([1, 3, 1, 3]) → False 27 | has_33([3, 1, 3]) → False 28 | ``` 29 | 30 | 8. Write a function that takes in a list of integers and returns True if it contains `007` in order 31 | ```python 32 | def spy_game(nums): 33 | pass 34 | 35 | spy_game([1,2,4,0,0,7,5]) --> True 36 | spy_game([1,0,2,4,0,5,7]) --> True 37 | spy_game([1,7,2,0,4,5,0]) --> False 38 | ``` 39 | 9. Write a function that computes the volume of a sphere given its radius. 40 | 41 | 10. Write a Python function that takes a list and returns a new list with unique elements of the first list. Note: don't use collection `set`. 42 | 43 | 11. Write a Python function that checks whether a word or phrase is `palindrome` or not. Note: A palindrome is word, phrase, or sequence that reads the same backward as forward, e.g., madam 44 | 45 | 12. Define a functino `histogram()` that takes a list of integers and prints a histogram to the screen. For example, `histogram([4, 9, 7])` should print the following: 46 | ``` 47 | **** 48 | ********* 49 | ******* 50 | ``` 51 | 52 | 13. Write a program able to play the `"Guess the number"` - game, where the number to be guessed is randomly chosen between 1 and 20. This is how it should work when run in a terminal: 53 | ``` 54 | Hello! What is your name? 55 | KBTU 56 | 57 | Well, KBTU, I am thinking of a number between 1 and 20. 58 | Take a guess. 59 | 12 60 | 61 | Your guess is too low. 62 | Take a guess. 63 | 16 64 | 65 | Your guess is too low. 66 | Take a guess. 67 | 19 68 | 69 | Good job, KBTU! You guessed my number in 3 guesses! 70 | ``` 71 | 72 | 14. Create a python file and import some of the functions from the above 13 tasks and try to use them. 73 | 74 | 75 | -------------------------------------------------------------------------------- /Lab3/functions2.md: -------------------------------------------------------------------------------- 1 | ## Python Function 2 | 3 | ```python 4 | # Dictionary of movies 5 | 6 | movies = [ 7 | { 8 | "name": "Usual Suspects", 9 | "imdb": 7.0, 10 | "category": "Thriller" 11 | }, 12 | { 13 | "name": "Hitman", 14 | "imdb": 6.3, 15 | "category": "Action" 16 | }, 17 | { 18 | "name": "Dark Knight", 19 | "imdb": 9.0, 20 | "category": "Adventure" 21 | }, 22 | { 23 | "name": "The Help", 24 | "imdb": 8.0, 25 | "category": "Drama" 26 | }, 27 | { 28 | "name": "The Choice", 29 | "imdb": 6.2, 30 | "category": "Romance" 31 | }, 32 | { 33 | "name": "Colonia", 34 | "imdb": 7.4, 35 | "category": "Romance" 36 | }, 37 | { 38 | "name": "Love", 39 | "imdb": 6.0, 40 | "category": "Romance" 41 | }, 42 | { 43 | "name": "Bride Wars", 44 | "imdb": 5.4, 45 | "category": "Romance" 46 | }, 47 | { 48 | "name": "AlphaJet", 49 | "imdb": 3.2, 50 | "category": "War" 51 | }, 52 | { 53 | "name": "Ringing Crime", 54 | "imdb": 4.0, 55 | "category": "Crime" 56 | }, 57 | { 58 | "name": "Joking muck", 59 | "imdb": 7.2, 60 | "category": "Comedy" 61 | }, 62 | { 63 | "name": "What is the name", 64 | "imdb": 9.2, 65 | "category": "Suspense" 66 | }, 67 | { 68 | "name": "Detective", 69 | "imdb": 7.0, 70 | "category": "Suspense" 71 | }, 72 | { 73 | "name": "Exam", 74 | "imdb": 4.2, 75 | "category": "Thriller" 76 | }, 77 | { 78 | "name": "We Two", 79 | "imdb": 7.2, 80 | "category": "Romance" 81 | } 82 | ] 83 | ``` 84 | 85 | 1. Write a function that takes a single movie and returns `True` if its IMDB score is above 5.5 86 | 87 | 2. Write a function that returns a sublist of movies with an IMDB score above 5.5. 88 | 89 | 3. Write a function that takes a category name and returns just those movies under that category. 90 | 91 | 4. Write a function that takes a list of movies and computes the average IMDB score. 92 | 93 | 5. Write a function that takes a category and computes the average IMDB score. 94 | -------------------------------------------------------------------------------- /Lab4/README.md: -------------------------------------------------------------------------------- 1 | ## Lab 4 2 | 3 | ### Topics covered in this lab work 4 | 5 | 1. Python Iterators, Generators 6 | 2. Python Scope 7 | 3. Python Modules 8 | 4. Python Dates 9 | 5. Python Math 10 | 11. Python JSON -------------------------------------------------------------------------------- /Lab4/date.md: -------------------------------------------------------------------------------- 1 | ## Python date 2 | 3 | 1. Write a Python program to subtract five days from current date. 4 | 5 | 2. Write a Python program to print yesterday, today, tomorrow. 6 | 7 | 3. Write a Python program to drop microseconds from datetime. 8 | 9 | 4. Write a Python program to calculate two date difference in seconds. 10 | -------------------------------------------------------------------------------- /Lab4/generators.md: -------------------------------------------------------------------------------- 1 | ## Python iterators and generators 2 | 3 | 1. Create a generator that generates the squares of numbers up to some number `N`. 4 | 5 | 2. Write a program using generator to print the even numbers between 0 and `n` in comma separated form where `n` is input from console. 6 | 7 | 3. Define a function with a generator which can iterate the numbers, which are divisible by 3 and 4, between a given range 0 and `n`. 8 | 9 | 4. Implement a generator called `squares` to yield the square of all numbers from (a) to (b). Test it with a "for" loop and print each of the yielded values. 10 | 11 | 5. Implement a generator that returns all numbers from (n) down to 0. 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Lab4/json/README.md: -------------------------------------------------------------------------------- 1 | ## Python JSON parsing 2 | 3 | Exercises to parse json data in python 4 | 5 | ## Exercise 1 6 | > Using data file `sample-data.json`, create output that resembles the following by parsing the included JSON file. 7 | 8 | ``` 9 | Interface Status 10 | ================================================================================ 11 | DN Description Speed MTU 12 | -------------------------------------------------- -------------------- ------ ------ 13 | topology/pod-1/node-201/sys/phys-[eth1/33] inherit 9150 14 | topology/pod-1/node-201/sys/phys-[eth1/34] inherit 9150 15 | topology/pod-1/node-201/sys/phys-[eth1/35] inherit 9150 16 | ``` -------------------------------------------------------------------------------- /Lab4/json/sample-data.json: -------------------------------------------------------------------------------- 1 | { 2 | "totalCount": "400", 3 | "imdata": [ 4 | { 5 | "l1PhysIf": { 6 | "attributes": { 7 | "adminSt": "up", 8 | "autoNeg": "on", 9 | "brkoutMap": "none", 10 | "bw": "0", 11 | "childAction": "", 12 | "delay": "1", 13 | "descr": "", 14 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/33]", 15 | "dot1qEtherType": "0x8100", 16 | "ethpmCfgFailedBmp": "", 17 | "ethpmCfgFailedTs": "00:00:00:00.000", 18 | "ethpmCfgState": "0", 19 | "fecMode": "inherit", 20 | "id": "eth1/33", 21 | "inhBw": "unspecified", 22 | "layer": "Layer3", 23 | "lcOwn": "local", 24 | "linkDebounce": "100", 25 | "linkLog": "default", 26 | "mdix": "auto", 27 | "medium": "broadcast", 28 | "modTs": "2016-11-28T16:03:29.317-05:00", 29 | "mode": "trunk", 30 | "monPolDn": "uni/fabric/monfab-default", 31 | "mtu": "9150", 32 | "name": "", 33 | "pathSDescr": "", 34 | "portT": "fab", 35 | "prioFlowCtrl": "auto", 36 | "qiqL2ProtTunMask": "", 37 | "routerMac": "not-applicable", 38 | "snmpTrapSt": "enable", 39 | "spanMode": "not-a-span-dest", 40 | "speed": "inherit", 41 | "status": "", 42 | "switchingSt": "disabled", 43 | "trunkLog": "default", 44 | "usage": "fabric,fabric-ext" 45 | } 46 | } 47 | }, 48 | { 49 | "l1PhysIf": { 50 | "attributes": { 51 | "adminSt": "up", 52 | "autoNeg": "on", 53 | "brkoutMap": "none", 54 | "bw": "0", 55 | "childAction": "", 56 | "delay": "1", 57 | "descr": "", 58 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/34]", 59 | "dot1qEtherType": "0x8100", 60 | "ethpmCfgFailedBmp": "", 61 | "ethpmCfgFailedTs": "00:00:00:00.000", 62 | "ethpmCfgState": "0", 63 | "fecMode": "inherit", 64 | "id": "eth1/34", 65 | "inhBw": "unspecified", 66 | "layer": "Layer3", 67 | "lcOwn": "local", 68 | "linkDebounce": "100", 69 | "linkLog": "default", 70 | "mdix": "auto", 71 | "medium": "broadcast", 72 | "modTs": "2016-11-28T16:03:29.317-05:00", 73 | "mode": "trunk", 74 | "monPolDn": "uni/fabric/monfab-default", 75 | "mtu": "9150", 76 | "name": "", 77 | "pathSDescr": "", 78 | "portT": "fab", 79 | "prioFlowCtrl": "auto", 80 | "qiqL2ProtTunMask": "", 81 | "routerMac": "not-applicable", 82 | "snmpTrapSt": "enable", 83 | "spanMode": "not-a-span-dest", 84 | "speed": "inherit", 85 | "status": "", 86 | "switchingSt": "disabled", 87 | "trunkLog": "default", 88 | "usage": "fabric,fabric-ext" 89 | } 90 | } 91 | }, 92 | { 93 | "l1PhysIf": { 94 | "attributes": { 95 | "adminSt": "up", 96 | "autoNeg": "on", 97 | "brkoutMap": "none", 98 | "bw": "0", 99 | "childAction": "", 100 | "delay": "1", 101 | "descr": "", 102 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/35]", 103 | "dot1qEtherType": "0x8100", 104 | "ethpmCfgFailedBmp": "", 105 | "ethpmCfgFailedTs": "00:00:00:00.000", 106 | "ethpmCfgState": "0", 107 | "fecMode": "inherit", 108 | "id": "eth1/35", 109 | "inhBw": "unspecified", 110 | "layer": "Layer3", 111 | "lcOwn": "local", 112 | "linkDebounce": "100", 113 | "linkLog": "default", 114 | "mdix": "auto", 115 | "medium": "broadcast", 116 | "modTs": "2016-11-28T16:03:29.317-05:00", 117 | "mode": "trunk", 118 | "monPolDn": "uni/fabric/monfab-default", 119 | "mtu": "9150", 120 | "name": "", 121 | "pathSDescr": "", 122 | "portT": "fab", 123 | "prioFlowCtrl": "auto", 124 | "qiqL2ProtTunMask": "", 125 | "routerMac": "not-applicable", 126 | "snmpTrapSt": "enable", 127 | "spanMode": "not-a-span-dest", 128 | "speed": "inherit", 129 | "status": "", 130 | "switchingSt": "disabled", 131 | "trunkLog": "default", 132 | "usage": "fabric,fabric-ext" 133 | } 134 | } 135 | }, 136 | { 137 | "l1PhysIf": { 138 | "attributes": { 139 | "adminSt": "up", 140 | "autoNeg": "on", 141 | "brkoutMap": "none", 142 | "bw": "0", 143 | "childAction": "", 144 | "delay": "1", 145 | "descr": "", 146 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/36]", 147 | "dot1qEtherType": "0x8100", 148 | "ethpmCfgFailedBmp": "", 149 | "ethpmCfgFailedTs": "00:00:00:00.000", 150 | "ethpmCfgState": "0", 151 | "fecMode": "inherit", 152 | "id": "eth1/36", 153 | "inhBw": "unspecified", 154 | "layer": "Layer3", 155 | "lcOwn": "local", 156 | "linkDebounce": "100", 157 | "linkLog": "default", 158 | "mdix": "auto", 159 | "medium": "broadcast", 160 | "modTs": "2016-11-28T16:03:29.317-05:00", 161 | "mode": "trunk", 162 | "monPolDn": "uni/fabric/monfab-default", 163 | "mtu": "9150", 164 | "name": "", 165 | "pathSDescr": "", 166 | "portT": "fab", 167 | "prioFlowCtrl": "auto", 168 | "qiqL2ProtTunMask": "", 169 | "routerMac": "not-applicable", 170 | "snmpTrapSt": "enable", 171 | "spanMode": "not-a-span-dest", 172 | "speed": "inherit", 173 | "status": "", 174 | "switchingSt": "disabled", 175 | "trunkLog": "default", 176 | "usage": "fabric,fabric-ext" 177 | } 178 | } 179 | }, 180 | { 181 | "l1PhysIf": { 182 | "attributes": { 183 | "adminSt": "up", 184 | "autoNeg": "on", 185 | "brkoutMap": "none", 186 | "bw": "0", 187 | "childAction": "", 188 | "delay": "1", 189 | "descr": "", 190 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/1]", 191 | "dot1qEtherType": "0x8100", 192 | "ethpmCfgFailedBmp": "", 193 | "ethpmCfgFailedTs": "00:00:00:00.000", 194 | "ethpmCfgState": "0", 195 | "fecMode": "inherit", 196 | "id": "eth1/1", 197 | "inhBw": "unspecified", 198 | "layer": "Layer3", 199 | "lcOwn": "local", 200 | "linkDebounce": "100", 201 | "linkLog": "default", 202 | "mdix": "auto", 203 | "medium": "broadcast", 204 | "modTs": "2017-06-30T06:35:49.634-05:00", 205 | "mode": "trunk", 206 | "monPolDn": "uni/fabric/monfab-default", 207 | "mtu": "9150", 208 | "name": "", 209 | "pathSDescr": "", 210 | "portT": "fab", 211 | "prioFlowCtrl": "auto", 212 | "qiqL2ProtTunMask": "", 213 | "routerMac": "not-applicable", 214 | "snmpTrapSt": "enable", 215 | "spanMode": "not-a-span-dest", 216 | "speed": "inherit", 217 | "status": "", 218 | "switchingSt": "enabled", 219 | "trunkLog": "default", 220 | "usage": "fabric" 221 | } 222 | } 223 | }, 224 | { 225 | "l1PhysIf": { 226 | "attributes": { 227 | "adminSt": "up", 228 | "autoNeg": "on", 229 | "brkoutMap": "none", 230 | "bw": "0", 231 | "childAction": "", 232 | "delay": "1", 233 | "descr": "", 234 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/2]", 235 | "dot1qEtherType": "0x8100", 236 | "ethpmCfgFailedBmp": "", 237 | "ethpmCfgFailedTs": "00:00:00:00.000", 238 | "ethpmCfgState": "0", 239 | "fecMode": "inherit", 240 | "id": "eth1/2", 241 | "inhBw": "unspecified", 242 | "layer": "Layer3", 243 | "lcOwn": "local", 244 | "linkDebounce": "100", 245 | "linkLog": "default", 246 | "mdix": "auto", 247 | "medium": "broadcast", 248 | "modTs": "2017-06-30T06:36:08.122-05:00", 249 | "mode": "trunk", 250 | "monPolDn": "uni/fabric/monfab-default", 251 | "mtu": "9150", 252 | "name": "", 253 | "pathSDescr": "", 254 | "portT": "fab", 255 | "prioFlowCtrl": "auto", 256 | "qiqL2ProtTunMask": "", 257 | "routerMac": "not-applicable", 258 | "snmpTrapSt": "enable", 259 | "spanMode": "not-a-span-dest", 260 | "speed": "inherit", 261 | "status": "", 262 | "switchingSt": "enabled", 263 | "trunkLog": "default", 264 | "usage": "fabric" 265 | } 266 | } 267 | }, 268 | { 269 | "l1PhysIf": { 270 | "attributes": { 271 | "adminSt": "up", 272 | "autoNeg": "on", 273 | "brkoutMap": "none", 274 | "bw": "0", 275 | "childAction": "", 276 | "delay": "1", 277 | "descr": "", 278 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/3]", 279 | "dot1qEtherType": "0x8100", 280 | "ethpmCfgFailedBmp": "", 281 | "ethpmCfgFailedTs": "00:00:00:00.000", 282 | "ethpmCfgState": "0", 283 | "fecMode": "inherit", 284 | "id": "eth1/3", 285 | "inhBw": "unspecified", 286 | "layer": "Layer3", 287 | "lcOwn": "local", 288 | "linkDebounce": "100", 289 | "linkLog": "default", 290 | "mdix": "auto", 291 | "medium": "broadcast", 292 | "modTs": "2017-06-30T06:36:10.100-05:00", 293 | "mode": "trunk", 294 | "monPolDn": "uni/fabric/monfab-default", 295 | "mtu": "9150", 296 | "name": "", 297 | "pathSDescr": "", 298 | "portT": "fab", 299 | "prioFlowCtrl": "auto", 300 | "qiqL2ProtTunMask": "", 301 | "routerMac": "not-applicable", 302 | "snmpTrapSt": "enable", 303 | "spanMode": "not-a-span-dest", 304 | "speed": "inherit", 305 | "status": "", 306 | "switchingSt": "enabled", 307 | "trunkLog": "default", 308 | "usage": "fabric" 309 | } 310 | } 311 | }, 312 | { 313 | "l1PhysIf": { 314 | "attributes": { 315 | "adminSt": "up", 316 | "autoNeg": "on", 317 | "brkoutMap": "none", 318 | "bw": "0", 319 | "childAction": "", 320 | "delay": "1", 321 | "descr": "", 322 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/4]", 323 | "dot1qEtherType": "0x8100", 324 | "ethpmCfgFailedBmp": "", 325 | "ethpmCfgFailedTs": "00:00:00:00.000", 326 | "ethpmCfgState": "0", 327 | "fecMode": "inherit", 328 | "id": "eth1/4", 329 | "inhBw": "unspecified", 330 | "layer": "Layer3", 331 | "lcOwn": "local", 332 | "linkDebounce": "100", 333 | "linkLog": "default", 334 | "mdix": "auto", 335 | "medium": "broadcast", 336 | "modTs": "2017-06-30T06:36:03.247-05:00", 337 | "mode": "trunk", 338 | "monPolDn": "uni/fabric/monfab-default", 339 | "mtu": "9150", 340 | "name": "", 341 | "pathSDescr": "", 342 | "portT": "fab", 343 | "prioFlowCtrl": "auto", 344 | "qiqL2ProtTunMask": "", 345 | "routerMac": "not-applicable", 346 | "snmpTrapSt": "enable", 347 | "spanMode": "not-a-span-dest", 348 | "speed": "inherit", 349 | "status": "", 350 | "switchingSt": "enabled", 351 | "trunkLog": "default", 352 | "usage": "fabric" 353 | } 354 | } 355 | }, 356 | { 357 | "l1PhysIf": { 358 | "attributes": { 359 | "adminSt": "up", 360 | "autoNeg": "on", 361 | "brkoutMap": "none", 362 | "bw": "0", 363 | "childAction": "", 364 | "delay": "1", 365 | "descr": "", 366 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/5]", 367 | "dot1qEtherType": "0x8100", 368 | "ethpmCfgFailedBmp": "", 369 | "ethpmCfgFailedTs": "00:00:00:00.000", 370 | "ethpmCfgState": "0", 371 | "fecMode": "inherit", 372 | "id": "eth1/5", 373 | "inhBw": "unspecified", 374 | "layer": "Layer3", 375 | "lcOwn": "local", 376 | "linkDebounce": "100", 377 | "linkLog": "default", 378 | "mdix": "auto", 379 | "medium": "broadcast", 380 | "modTs": "2016-11-28T16:03:29.317-05:00", 381 | "mode": "trunk", 382 | "monPolDn": "uni/fabric/monfab-default", 383 | "mtu": "9150", 384 | "name": "", 385 | "pathSDescr": "", 386 | "portT": "fab", 387 | "prioFlowCtrl": "auto", 388 | "qiqL2ProtTunMask": "", 389 | "routerMac": "not-applicable", 390 | "snmpTrapSt": "enable", 391 | "spanMode": "not-a-span-dest", 392 | "speed": "inherit", 393 | "status": "", 394 | "switchingSt": "disabled", 395 | "trunkLog": "default", 396 | "usage": "fabric,fabric-ext" 397 | } 398 | } 399 | }, 400 | { 401 | "l1PhysIf": { 402 | "attributes": { 403 | "adminSt": "up", 404 | "autoNeg": "on", 405 | "brkoutMap": "none", 406 | "bw": "0", 407 | "childAction": "", 408 | "delay": "1", 409 | "descr": "", 410 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/6]", 411 | "dot1qEtherType": "0x8100", 412 | "ethpmCfgFailedBmp": "", 413 | "ethpmCfgFailedTs": "00:00:00:00.000", 414 | "ethpmCfgState": "0", 415 | "fecMode": "inherit", 416 | "id": "eth1/6", 417 | "inhBw": "unspecified", 418 | "layer": "Layer3", 419 | "lcOwn": "local", 420 | "linkDebounce": "100", 421 | "linkLog": "default", 422 | "mdix": "auto", 423 | "medium": "broadcast", 424 | "modTs": "2016-11-28T16:03:29.317-05:00", 425 | "mode": "trunk", 426 | "monPolDn": "uni/fabric/monfab-default", 427 | "mtu": "9150", 428 | "name": "", 429 | "pathSDescr": "", 430 | "portT": "fab", 431 | "prioFlowCtrl": "auto", 432 | "qiqL2ProtTunMask": "", 433 | "routerMac": "not-applicable", 434 | "snmpTrapSt": "enable", 435 | "spanMode": "not-a-span-dest", 436 | "speed": "inherit", 437 | "status": "", 438 | "switchingSt": "disabled", 439 | "trunkLog": "default", 440 | "usage": "fabric,fabric-ext" 441 | } 442 | } 443 | }, 444 | { 445 | "l1PhysIf": { 446 | "attributes": { 447 | "adminSt": "up", 448 | "autoNeg": "on", 449 | "brkoutMap": "none", 450 | "bw": "0", 451 | "childAction": "", 452 | "delay": "1", 453 | "descr": "", 454 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/7]", 455 | "dot1qEtherType": "0x8100", 456 | "ethpmCfgFailedBmp": "", 457 | "ethpmCfgFailedTs": "00:00:00:00.000", 458 | "ethpmCfgState": "0", 459 | "fecMode": "inherit", 460 | "id": "eth1/7", 461 | "inhBw": "unspecified", 462 | "layer": "Layer3", 463 | "lcOwn": "local", 464 | "linkDebounce": "100", 465 | "linkLog": "default", 466 | "mdix": "auto", 467 | "medium": "broadcast", 468 | "modTs": "2016-11-28T16:03:29.317-05:00", 469 | "mode": "trunk", 470 | "monPolDn": "uni/fabric/monfab-default", 471 | "mtu": "9150", 472 | "name": "", 473 | "pathSDescr": "", 474 | "portT": "fab", 475 | "prioFlowCtrl": "auto", 476 | "qiqL2ProtTunMask": "", 477 | "routerMac": "not-applicable", 478 | "snmpTrapSt": "enable", 479 | "spanMode": "not-a-span-dest", 480 | "speed": "inherit", 481 | "status": "", 482 | "switchingSt": "disabled", 483 | "trunkLog": "default", 484 | "usage": "fabric,fabric-ext" 485 | } 486 | } 487 | }, 488 | { 489 | "l1PhysIf": { 490 | "attributes": { 491 | "adminSt": "up", 492 | "autoNeg": "on", 493 | "brkoutMap": "none", 494 | "bw": "0", 495 | "childAction": "", 496 | "delay": "1", 497 | "descr": "", 498 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/8]", 499 | "dot1qEtherType": "0x8100", 500 | "ethpmCfgFailedBmp": "", 501 | "ethpmCfgFailedTs": "00:00:00:00.000", 502 | "ethpmCfgState": "0", 503 | "fecMode": "inherit", 504 | "id": "eth1/8", 505 | "inhBw": "unspecified", 506 | "layer": "Layer3", 507 | "lcOwn": "local", 508 | "linkDebounce": "100", 509 | "linkLog": "default", 510 | "mdix": "auto", 511 | "medium": "broadcast", 512 | "modTs": "2016-11-28T16:03:29.317-05:00", 513 | "mode": "trunk", 514 | "monPolDn": "uni/fabric/monfab-default", 515 | "mtu": "9150", 516 | "name": "", 517 | "pathSDescr": "", 518 | "portT": "fab", 519 | "prioFlowCtrl": "auto", 520 | "qiqL2ProtTunMask": "", 521 | "routerMac": "not-applicable", 522 | "snmpTrapSt": "enable", 523 | "spanMode": "not-a-span-dest", 524 | "speed": "inherit", 525 | "status": "", 526 | "switchingSt": "disabled", 527 | "trunkLog": "default", 528 | "usage": "fabric,fabric-ext" 529 | } 530 | } 531 | }, 532 | { 533 | "l1PhysIf": { 534 | "attributes": { 535 | "adminSt": "up", 536 | "autoNeg": "on", 537 | "brkoutMap": "none", 538 | "bw": "0", 539 | "childAction": "", 540 | "delay": "1", 541 | "descr": "", 542 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/9]", 543 | "dot1qEtherType": "0x8100", 544 | "ethpmCfgFailedBmp": "", 545 | "ethpmCfgFailedTs": "00:00:00:00.000", 546 | "ethpmCfgState": "0", 547 | "fecMode": "inherit", 548 | "id": "eth1/9", 549 | "inhBw": "unspecified", 550 | "layer": "Layer3", 551 | "lcOwn": "local", 552 | "linkDebounce": "100", 553 | "linkLog": "default", 554 | "mdix": "auto", 555 | "medium": "broadcast", 556 | "modTs": "2016-11-28T16:03:29.317-05:00", 557 | "mode": "trunk", 558 | "monPolDn": "uni/fabric/monfab-default", 559 | "mtu": "9150", 560 | "name": "", 561 | "pathSDescr": "", 562 | "portT": "fab", 563 | "prioFlowCtrl": "auto", 564 | "qiqL2ProtTunMask": "", 565 | "routerMac": "not-applicable", 566 | "snmpTrapSt": "enable", 567 | "spanMode": "not-a-span-dest", 568 | "speed": "inherit", 569 | "status": "", 570 | "switchingSt": "disabled", 571 | "trunkLog": "default", 572 | "usage": "fabric,fabric-ext" 573 | } 574 | } 575 | }, 576 | { 577 | "l1PhysIf": { 578 | "attributes": { 579 | "adminSt": "up", 580 | "autoNeg": "on", 581 | "brkoutMap": "none", 582 | "bw": "0", 583 | "childAction": "", 584 | "delay": "1", 585 | "descr": "", 586 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/10]", 587 | "dot1qEtherType": "0x8100", 588 | "ethpmCfgFailedBmp": "", 589 | "ethpmCfgFailedTs": "00:00:00:00.000", 590 | "ethpmCfgState": "0", 591 | "fecMode": "inherit", 592 | "id": "eth1/10", 593 | "inhBw": "unspecified", 594 | "layer": "Layer3", 595 | "lcOwn": "local", 596 | "linkDebounce": "100", 597 | "linkLog": "default", 598 | "mdix": "auto", 599 | "medium": "broadcast", 600 | "modTs": "2016-11-28T16:03:29.317-05:00", 601 | "mode": "trunk", 602 | "monPolDn": "uni/fabric/monfab-default", 603 | "mtu": "9150", 604 | "name": "", 605 | "pathSDescr": "", 606 | "portT": "fab", 607 | "prioFlowCtrl": "auto", 608 | "qiqL2ProtTunMask": "", 609 | "routerMac": "not-applicable", 610 | "snmpTrapSt": "enable", 611 | "spanMode": "not-a-span-dest", 612 | "speed": "inherit", 613 | "status": "", 614 | "switchingSt": "disabled", 615 | "trunkLog": "default", 616 | "usage": "fabric,fabric-ext" 617 | } 618 | } 619 | }, 620 | { 621 | "l1PhysIf": { 622 | "attributes": { 623 | "adminSt": "up", 624 | "autoNeg": "on", 625 | "brkoutMap": "none", 626 | "bw": "0", 627 | "childAction": "", 628 | "delay": "1", 629 | "descr": "", 630 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/11]", 631 | "dot1qEtherType": "0x8100", 632 | "ethpmCfgFailedBmp": "", 633 | "ethpmCfgFailedTs": "00:00:00:00.000", 634 | "ethpmCfgState": "0", 635 | "fecMode": "inherit", 636 | "id": "eth1/11", 637 | "inhBw": "unspecified", 638 | "layer": "Layer3", 639 | "lcOwn": "local", 640 | "linkDebounce": "100", 641 | "linkLog": "default", 642 | "mdix": "auto", 643 | "medium": "broadcast", 644 | "modTs": "2016-11-28T16:03:29.317-05:00", 645 | "mode": "trunk", 646 | "monPolDn": "uni/fabric/monfab-default", 647 | "mtu": "9150", 648 | "name": "", 649 | "pathSDescr": "", 650 | "portT": "fab", 651 | "prioFlowCtrl": "auto", 652 | "qiqL2ProtTunMask": "", 653 | "routerMac": "not-applicable", 654 | "snmpTrapSt": "enable", 655 | "spanMode": "not-a-span-dest", 656 | "speed": "inherit", 657 | "status": "", 658 | "switchingSt": "disabled", 659 | "trunkLog": "default", 660 | "usage": "fabric,fabric-ext" 661 | } 662 | } 663 | }, 664 | { 665 | "l1PhysIf": { 666 | "attributes": { 667 | "adminSt": "up", 668 | "autoNeg": "on", 669 | "brkoutMap": "none", 670 | "bw": "0", 671 | "childAction": "", 672 | "delay": "1", 673 | "descr": "", 674 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/12]", 675 | "dot1qEtherType": "0x8100", 676 | "ethpmCfgFailedBmp": "", 677 | "ethpmCfgFailedTs": "00:00:00:00.000", 678 | "ethpmCfgState": "0", 679 | "fecMode": "inherit", 680 | "id": "eth1/12", 681 | "inhBw": "unspecified", 682 | "layer": "Layer3", 683 | "lcOwn": "local", 684 | "linkDebounce": "100", 685 | "linkLog": "default", 686 | "mdix": "auto", 687 | "medium": "broadcast", 688 | "modTs": "2016-11-28T16:03:29.317-05:00", 689 | "mode": "trunk", 690 | "monPolDn": "uni/fabric/monfab-default", 691 | "mtu": "9150", 692 | "name": "", 693 | "pathSDescr": "", 694 | "portT": "fab", 695 | "prioFlowCtrl": "auto", 696 | "qiqL2ProtTunMask": "", 697 | "routerMac": "not-applicable", 698 | "snmpTrapSt": "enable", 699 | "spanMode": "not-a-span-dest", 700 | "speed": "inherit", 701 | "status": "", 702 | "switchingSt": "disabled", 703 | "trunkLog": "default", 704 | "usage": "fabric,fabric-ext" 705 | } 706 | } 707 | }, 708 | { 709 | "l1PhysIf": { 710 | "attributes": { 711 | "adminSt": "up", 712 | "autoNeg": "on", 713 | "brkoutMap": "none", 714 | "bw": "0", 715 | "childAction": "", 716 | "delay": "1", 717 | "descr": "", 718 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/13]", 719 | "dot1qEtherType": "0x8100", 720 | "ethpmCfgFailedBmp": "", 721 | "ethpmCfgFailedTs": "00:00:00:00.000", 722 | "ethpmCfgState": "0", 723 | "fecMode": "inherit", 724 | "id": "eth1/13", 725 | "inhBw": "unspecified", 726 | "layer": "Layer3", 727 | "lcOwn": "local", 728 | "linkDebounce": "100", 729 | "linkLog": "default", 730 | "mdix": "auto", 731 | "medium": "broadcast", 732 | "modTs": "2016-11-28T16:03:29.317-05:00", 733 | "mode": "trunk", 734 | "monPolDn": "uni/fabric/monfab-default", 735 | "mtu": "9150", 736 | "name": "", 737 | "pathSDescr": "", 738 | "portT": "fab", 739 | "prioFlowCtrl": "auto", 740 | "qiqL2ProtTunMask": "", 741 | "routerMac": "not-applicable", 742 | "snmpTrapSt": "enable", 743 | "spanMode": "not-a-span-dest", 744 | "speed": "inherit", 745 | "status": "", 746 | "switchingSt": "disabled", 747 | "trunkLog": "default", 748 | "usage": "fabric,fabric-ext" 749 | } 750 | } 751 | }, 752 | { 753 | "l1PhysIf": { 754 | "attributes": { 755 | "adminSt": "up", 756 | "autoNeg": "on", 757 | "brkoutMap": "none", 758 | "bw": "0", 759 | "childAction": "", 760 | "delay": "1", 761 | "descr": "", 762 | "dn": "topology/pod-1/node-201/sys/phys-[eth1/14]", 763 | "dot1qEtherType": "0x8100", 764 | "ethpmCfgFailedBmp": "", 765 | "ethpmCfgFailedTs": "00:00:00:00.000", 766 | "ethpmCfgState": "0", 767 | "fecMode": "inherit", 768 | "id": "eth1/14", 769 | "inhBw": "unspecified", 770 | "layer": "Layer3", 771 | "lcOwn": "local", 772 | "linkDebounce": "100", 773 | "linkLog": "default", 774 | "mdix": "auto", 775 | "medium": "broadcast", 776 | "modTs": "2016-11-28T16:03:29.317-05:00", 777 | "mode": "trunk", 778 | "monPolDn": "uni/fabric/monfab-default", 779 | "mtu": "9150", 780 | "name": "", 781 | "pathSDescr": "", 782 | "portT": "fab", 783 | "prioFlowCtrl": "auto", 784 | "qiqL2ProtTunMask": "", 785 | "routerMac": "not-applicable", 786 | "snmpTrapSt": "enable", 787 | "spanMode": "not-a-span-dest", 788 | "speed": "inherit", 789 | "status": "", 790 | "switchingSt": "disabled", 791 | "trunkLog": "default", 792 | "usage": "fabric,fabric-ext" 793 | } 794 | } 795 | } 796 | ] 797 | } -------------------------------------------------------------------------------- /Lab4/math.md: -------------------------------------------------------------------------------- 1 | ## Python Math library 2 | 3 | 1. Write a Python program to convert degree to radian. 4 | ``` 5 | Input degree: 15 6 | Output radian: 0.261904 7 | ``` 8 | 9 | 2. Write a Python program to calculate the area of a trapezoid. 10 | ``` 11 | Height: 5 12 | Base, first value: 5 13 | Base, second value: 6 14 | Expected Output: 27.5 15 | ``` 16 | 17 | 3. Write a Python program to calculate the area of regular polygon. 18 | ``` 19 | Input number of sides: 4 20 | Input the length of a side: 25 21 | The area of the polygon is: 625 22 | ``` 23 | 24 | 4. Write a Python program to calculate the area of a parallelogram. 25 | ``` 26 | Length of base: 5 27 | Height of parallelogram: 6 28 | Expected Output: 30.0 29 | ``` 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Lab5/README.md: -------------------------------------------------------------------------------- 1 | ## Lab 5 2 | 3 | ### Topics covered in this lab work 4 | 5 | 1. Python RegEx 6 | 7 | You can practice from Lecture example of receipt parsing using `row.txt` file in this folder. -------------------------------------------------------------------------------- /Lab5/regex.md: -------------------------------------------------------------------------------- 1 | ## Python RegEx exercises 2 | 3 | 1. Write a Python program that matches a string that has an `'a'` followed by zero or more `'b'`'s. 4 | 5 | 2. Write a Python program that matches a string that has an `'a'` followed by two to three `'b'`. 6 | 7 | 3. Write a Python program to find sequences of lowercase letters joined with a underscore. 8 | 9 | 4. Write a Python program to find the sequences of one upper case letter followed by lower case letters. 10 | 11 | 5. Write a Python program that matches a string that has an `'a'` followed by anything, ending in `'b'`. 12 | 13 | 6. Write a Python program to replace all occurrences of space, comma, or dot with a colon. 14 | 15 | 7. Write a python program to convert snake case string to camel case string. 16 | 17 | 8. Write a Python program to split a string at uppercase letters. 18 | 19 | 9. Write a Python program to insert spaces between words starting with capital letters. 20 | 21 | 10. Write a Python program to convert a given camel case string to snake case. 22 | -------------------------------------------------------------------------------- /Lab5/row.txt: -------------------------------------------------------------------------------- 1 | ДУБЛИКАТ 2 | Филиал ТОО EUROPHARMA Астана 3 | БИН 080841000761 4 | НДС Серия 58001 5 | № 0014377 6 | Касса 300-189 7 | Смена 10 8 | Порядковый номер чека №64 9 | Чек №2331180266 10 | Кассир Аптека 17-1 11 | ПРОДАЖА 12 | 1. 13 | Натрия хлорид 0,9%, 200 мл, фл 14 | 2,000 x 154,00 15 | 308,00 16 | Стоимость 17 | 308,00 18 | 2. 19 | Борный спирт 3%, 20 мл, фл. 20 | 1,000 x 51,00 21 | 51,00 22 | Стоимость 23 | 51,00 24 | 3. 25 | Шприц 2 мл, 3-х комп. (Bioject) 26 | 2,000 x 16,00 27 | 32,00 28 | Стоимость 29 | 32,00 30 | 4. 31 | Система для инфузии Vogt Medical 32 | 2,000 x 60,00 33 | 120,00 34 | Стоимость 35 | 120,00 36 | 5. 37 | Naturella прокладки Классик макси №8 38 | 1,000 x 310,00 39 | 310,00 40 | Стоимость 41 | 310,00 42 | 6. 43 | AURA Ватные диски №150 44 | 1,000 x 461,00 45 | 461,00 46 | Стоимость 47 | 461,00 48 | 7. 49 | Чистая линия скраб мягкий 50 мл 50 | 1,000 x 381,00 51 | 381,00 52 | Стоимость 53 | 381,00 54 | 8. 55 | Чистая линия скраб очищающийабрикос 50 мл 56 | 1,000 x 386,00 57 | 386,00 58 | Стоимость 59 | 386,00 60 | 9. 61 | Чистая линия скраб мягкий 50 мл 62 | 1,000 x 381,00 63 | 381,00 64 | Стоимость 65 | 381,00 66 | 10. 67 | Carefree салфетки Алоэвоздухопроницаемые №20 68 | 1,000 x 414,00 69 | 414,00 70 | Стоимость 71 | 414,00 72 | 11. 73 | Pro Series Шампунь яркий цвет 500мл 74 | 1,000 x 841,00 75 | 841,00 76 | Стоимость 77 | 841,00 78 | 12. 79 | Pro Series бальзам-ополаскивательдля длител ухода за окрашеннымиволосами Яркий цвет 500мл 80 | 1,000 x 841,00 81 | 841,00 82 | Стоимость 83 | 841,00 84 | 13. 85 | Clear шампунь Актив спорт 2в1мужской 400 мл 86 | 1,000 x 1 200,00 87 | 1 200,00 88 | Стоимость 89 | 1 200,00 90 | 14. 91 | Bio World (HYDRO THERAPY)Мицеллярная вода 5в1, 445мл 92 | 1,000 x 1 152,00 93 | 1 152,00 94 | Стоимость 95 | 1 152,00 96 | 15. 97 | Bio World (HYDRO THERAPY) Гель-муссдля умывания с гиалуроновойкислотой, 250мл 98 | 1,000 x 1 152,00 99 | 1 152,00 100 | Стоимость 101 | 1 152,00 102 | 16. 103 | [RX]-Натрия хлорид 0,9%, 100 мл, фл. 104 | 1,000 x 168,00 105 | 168,00 106 | Стоимость 107 | 168,00 108 | 17. 109 | [RX]-Дисоль р-р 400 мл, фл. 110 | 1,000 x 163,00 111 | 163,00 112 | Стоимость 113 | 163,00 114 | 18. 115 | Тагансорбент с иономи серебра №30,пор. 116 | 1,000 x 1 526,00 117 | 1 526,00 118 | Стоимость 119 | 1 526,00 120 | 19. 121 | [RX]-Церукал 2%, 2 мл, №10, амп. 122 | 2,000 x 396,00 123 | 792,00 124 | Стоимость 125 | 792,00 126 | 20. 127 | [RX]-Андазол 200 мг, №40, табл. 128 | 1,000 x 7 330,00 129 | 7 330,00 130 | Стоимость 131 | 7 330,00 132 | Банковская карта: 133 | 18 009,00 134 | ИТОГО: 135 | 18 009,00 136 | в т.ч. НДС 12%: 137 | 0,00 138 | Фискальный признак: 139 | 2331180266 140 | Время: 18.04.2019 11:13:58 141 | г. Нур-султан,Казахстан, Мангилик Ел,19, нп-5 142 | Оператор фискальных данных: АО"Казахтелеком"Для проверки чека зайдите на сайт:consumer.oofd.kz 143 | ФИСКАЛЬНЫЙ ЧЕК 144 | ФП 145 | ИНК ОФД: 311559 146 | Код ККМ КГД (РНМ): 620300145316 147 | ЗНМ: SWK00034961 148 | WEBKASSA.KZ 149 | -------------------------------------------------------------------------------- /Lab6/README.md: -------------------------------------------------------------------------------- 1 | ## Lab 6 2 | 3 | ### Topics covered in this lab work 4 | 5 | 1. Directories and files. 6 | * Python File Handling: Read, Write, Create and Delete 7 | * Working with directories 8 | 9 | 2. Builtin function of python. 10 | -------------------------------------------------------------------------------- /Lab6/builtin-functions.md: -------------------------------------------------------------------------------- 1 | ## Python builtin functions exercises 2 | 3 | 1. Write a Python program with builtin function to multiply all the numbers in a list 4 | 2. Write a Python program with builtin function that accepts a string and calculate the number of upper case letters and lower case letters 5 | 3. Write a Python program with builtin function that checks whether a passed string is palindrome or not. 6 | 4. Write a Python program that invoke square root function after specific milliseconds. 7 | ``` 8 | Sample Input: 9 | 25100 10 | 2123 11 | Sample Output: 12 | Square root of 25100 after 2123 miliseconds is 158.42979517754858 13 | ```` 14 | 5. Write a Python program with builtin function that returns True if all elements of the tuple are true. -------------------------------------------------------------------------------- /Lab6/dir-and-files.md: -------------------------------------------------------------------------------- 1 | ## Python Directories and Files exercises 2 | 3 | 1. Write a Python program to list only directories, files and all directories, files in a specified path. 4 | 2. Write a Python program to check for access to a specified path. Test the existence, readability, writability and executability of the specified path 5 | 3. Write a Python program to test whether a given path exists or not. If the path exist find the filename and directory portion of the given path. 6 | 4. Write a Python program to count the number of lines in a text file. 7 | 5. Write a Python program to write a list to a file. 8 | 6. Write a Python program to generate 26 text files named A.txt, B.txt, and so on up to Z.txt 9 | 7. Write a Python program to copy the contents of a file to another file 10 | 8. Write a Python program to delete file by specified path. Before deleting check for access and whether a given path exists or not. 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Programming Principles 2 2 | 3 | Lab exercises --------------------------------------------------------------------------------