|
5 | 5 | "colab": {
|
6 | 6 | "name": "marathon_day2.ipynb",
|
7 | 7 | "provenance": [],
|
8 |
| - "authorship_tag": "ABX9TyNah8lGqIqLPVbg2Riz0OOS", |
| 8 | + "authorship_tag": "ABX9TyM272CXcfyqHYjAUQ0lZdpX", |
9 | 9 | "include_colab_link": true
|
10 | 10 | },
|
11 | 11 | "kernelspec": {
|
|
46 | 46 | "metadata": {
|
47 | 47 | "id": "LqJg6PVfW76b",
|
48 | 48 | "colab_type": "code",
|
| 49 | + "outputId": "610507a9-d8d3-48b3-c86f-e4de83bc7580", |
49 | 50 | "colab": {
|
50 | 51 | "base_uri": "https://localhost:8080/",
|
51 | 52 | "height": 51
|
52 |
| - }, |
53 |
| - "outputId": "610507a9-d8d3-48b3-c86f-e4de83bc7580" |
| 53 | + } |
54 | 54 | },
|
55 | 55 | "source": [
|
56 | 56 | "year = int(input('Enter the year: '))\n",
|
|
59 | 59 | "else:\n",
|
60 | 60 | " print(year, 'Year is not leap')"
|
61 | 61 | ],
|
62 |
| - "execution_count": 2, |
| 62 | + "execution_count": 0, |
63 | 63 | "outputs": [
|
64 | 64 | {
|
65 | 65 | "output_type": "stream",
|
|
87 | 87 | "metadata": {
|
88 | 88 | "id": "FZfwOAmYXMWz",
|
89 | 89 | "colab_type": "code",
|
| 90 | + "outputId": "6e91f2ee-f3e4-4788-dc2e-a6dba71c5de2", |
90 | 91 | "colab": {
|
91 | 92 | "base_uri": "https://localhost:8080/",
|
92 | 93 | "height": 51
|
93 |
| - }, |
94 |
| - "outputId": "6e91f2ee-f3e4-4788-dc2e-a6dba71c5de2" |
| 94 | + } |
95 | 95 | },
|
96 | 96 | "source": [
|
97 | 97 | "a = int(input('Enter the number '))\n",
|
|
100 | 100 | "n3 = int( \"%s%s%s\" % (a,a,a) )\n",
|
101 | 101 | "print (n1*n2*n3)"
|
102 | 102 | ],
|
103 |
| - "execution_count": 4, |
| 103 | + "execution_count": 0, |
104 | 104 | "outputs": [
|
105 | 105 | {
|
106 | 106 | "output_type": "stream",
|
|
127 | 127 | "metadata": {
|
128 | 128 | "id": "JnbO_eSeZW93",
|
129 | 129 | "colab_type": "code",
|
| 130 | + "outputId": "ab949fab-226b-4baa-e833-a2c3642d9aed", |
130 | 131 | "colab": {
|
131 | 132 | "base_uri": "https://localhost:8080/",
|
132 | 133 | "height": 51
|
133 |
| - }, |
134 |
| - "outputId": "ab949fab-226b-4baa-e833-a2c3642d9aed" |
| 134 | + } |
135 | 135 | },
|
136 | 136 | "source": [
|
137 | 137 | "num = int(input(\"Enter a number: \"))\n",
|
|
141 | 141 | "else:\n",
|
142 | 142 | " print(\"This is an even number.\")"
|
143 | 143 | ],
|
144 |
| - "execution_count": 6, |
| 144 | + "execution_count": 0, |
145 | 145 | "outputs": [
|
146 | 146 | {
|
147 | 147 | "output_type": "stream",
|
|
168 | 168 | "metadata": {
|
169 | 169 | "id": "eY6rNdPTbLqU",
|
170 | 170 | "colab_type": "code",
|
| 171 | + "outputId": "f9f246fe-04cd-4728-d75b-eb425a1df615", |
171 | 172 | "colab": {
|
172 | 173 | "base_uri": "https://localhost:8080/",
|
173 | 174 | "height": 136
|
174 |
| - }, |
175 |
| - "outputId": "f9f246fe-04cd-4728-d75b-eb425a1df615" |
| 175 | + } |
176 | 176 | },
|
177 | 177 | "source": [
|
178 | 178 | "a = 5\n",
|
|
186 | 186 | "print(\"%d << 2 = %d (%s)\" % (b,b<<2,bin(b<<2)))\n",
|
187 | 187 | "print(\"%d >> 2 = %d (%s)\" % (b,b>>2,bin(b>>2)))"
|
188 | 188 | ],
|
189 |
| - "execution_count": 7, |
| 189 | + "execution_count": 0, |
190 | 190 | "outputs": [
|
191 | 191 | {
|
192 | 192 | "output_type": "stream",
|
|
274 | 274 | "metadata": {
|
275 | 275 | "id": "B2knO2fGeTD8",
|
276 | 276 | "colab_type": "code",
|
| 277 | + "outputId": "bebd3092-5855-46be-e35e-b244f32abbc6", |
277 | 278 | "colab": {
|
278 | 279 | "base_uri": "https://localhost:8080/",
|
279 | 280 | "height": 68
|
280 |
| - }, |
281 |
| - "outputId": "bebd3092-5855-46be-e35e-b244f32abbc6" |
| 281 | + } |
282 | 282 | },
|
283 | 283 | "source": [
|
284 | 284 | "a = input('Enter the first coordinates x,y: ').split(',')\n",
|
|
291 | 291 | "function = '{}x + {}y + {} = 0'.format(A, B, C)\n",
|
292 | 292 | "print(function)"
|
293 | 293 | ],
|
294 |
| - "execution_count": 14, |
| 294 | + "execution_count": 0, |
295 | 295 | "outputs": [
|
296 | 296 | {
|
297 | 297 | "output_type": "stream",
|
|
323 | 323 | "metadata": {
|
324 | 324 | "id": "038Axd7-bskK",
|
325 | 325 | "colab_type": "code",
|
| 326 | + "outputId": "10ca6339-c111-4122-f2ef-fec559b92dfc", |
326 | 327 | "colab": {
|
327 | 328 | "base_uri": "https://localhost:8080/",
|
328 | 329 | "height": 119
|
329 |
| - }, |
330 |
| - "outputId": "10ca6339-c111-4122-f2ef-fec559b92dfc" |
| 330 | + } |
331 | 331 | },
|
332 | 332 | "source": [
|
333 | 333 | "import random\n",
|
|
349 | 349 | "rand_uni = random.choice(chars[a:b])\n",
|
350 | 350 | "print('Random float number: {}'.format(rand_uni)) "
|
351 | 351 | ],
|
352 |
| - "execution_count": 15, |
| 352 | + "execution_count": 0, |
353 | 353 | "outputs": [
|
354 | 354 | {
|
355 | 355 | "output_type": "stream",
|
|
380 | 380 | "metadata": {
|
381 | 381 | "id": "eg4GPMzuc3EJ",
|
382 | 382 | "colab_type": "code",
|
| 383 | + "outputId": "ec264f3d-4379-46cc-c55e-015009e74f47", |
383 | 384 | "colab": {
|
384 | 385 | "base_uri": "https://localhost:8080/",
|
385 | 386 | "height": 68
|
386 |
| - }, |
387 |
| - "outputId": "ec264f3d-4379-46cc-c55e-015009e74f47" |
| 387 | + } |
388 | 388 | },
|
389 | 389 | "source": [
|
390 | 390 | "chars = 'abcdefghijklmnopqrstuvwxyz'\n",
|
|
400 | 400 | " second letter is {} - on {} position.\\\n",
|
401 | 401 | " Distance between them {}'.format(char_range[0], a, char_range[1], b, c))"
|
402 | 402 | ],
|
403 |
| - "execution_count": 12, |
| 403 | + "execution_count": 0, |
404 | 404 | "outputs": [
|
405 | 405 | {
|
406 | 406 | "output_type": "stream",
|
|
428 | 428 | "metadata": {
|
429 | 429 | "id": "rfg8vk4XjB2y",
|
430 | 430 | "colab_type": "code",
|
| 431 | + "outputId": "c7c1a3ab-362e-459f-d23e-15730fff0f09", |
431 | 432 | "colab": {
|
432 | 433 | "base_uri": "https://localhost:8080/",
|
433 | 434 | "height": 51
|
434 |
| - }, |
435 |
| - "outputId": "c7c1a3ab-362e-459f-d23e-15730fff0f09" |
| 435 | + } |
436 | 436 | },
|
437 | 437 | "source": [
|
438 | 438 | "chars = 'abcdefghijklmnopqrstuvwxyz'\n",
|
439 | 439 | "charindex = int(input('Enter the number of the letter'))\n",
|
440 | 440 | "char = chars[charindex-1]\n",
|
441 | 441 | "print('Letter: {}'.format(char))"
|
442 | 442 | ],
|
443 |
| - "execution_count": 18, |
| 443 | + "execution_count": 0, |
444 | 444 | "outputs": [
|
445 | 445 | {
|
446 | 446 | "output_type": "stream",
|
|
468 | 468 | "metadata": {
|
469 | 469 | "id": "XBtO1nC9g09_",
|
470 | 470 | "colab_type": "code",
|
| 471 | + "outputId": "e5dd6b48-e9d4-4f0b-fc49-6f62e797ce58", |
471 | 472 | "colab": {
|
472 | 473 | "base_uri": "https://localhost:8080/",
|
473 | 474 | "height": 68
|
474 |
| - }, |
475 |
| - "outputId": "e5dd6b48-e9d4-4f0b-fc49-6f62e797ce58" |
| 475 | + } |
476 | 476 | },
|
477 | 477 | "source": [
|
478 | 478 | "list_lenght = input('Enter the lengths of the triangle sides through the format x,y,z: ').split(',')\n",
|
|
497 | 497 | "else:\n",
|
498 | 498 | " print('Its not triangle')"
|
499 | 499 | ],
|
500 |
| - "execution_count": 17, |
| 500 | + "execution_count": 0, |
501 | 501 | "outputs": [
|
502 | 502 | {
|
503 | 503 | "output_type": "stream",
|
|
526 | 526 | "metadata": {
|
527 | 527 | "id": "IyaHw2nKX6WR",
|
528 | 528 | "colab_type": "code",
|
| 529 | + "outputId": "e7d2d032-5d9e-4ee1-f1fa-8a45a6299571", |
529 | 530 | "colab": {
|
530 | 531 | "base_uri": "https://localhost:8080/",
|
531 | 532 | "height": 102
|
532 |
| - }, |
533 |
| - "outputId": "e7d2d032-5d9e-4ee1-f1fa-8a45a6299571" |
| 533 | + } |
534 | 534 | },
|
535 | 535 | "source": [
|
536 | 536 | "print('Enter three numbers: ')\n",
|
|
539 | 539 | "c = int(input())\n",
|
540 | 540 | " \n",
|
541 | 541 | "if (a==b and a==c) or (b==c and b==a) or (c==a and c==b):\n",
|
542 |
| - " print('There equal numbers, try again')\n", |
| 542 | + " print('There are equal numbers, try again')\n", |
543 | 543 | "elif b < a < c or c < a < b:\n",
|
544 | 544 | " print('Medium:', a)\n",
|
545 | 545 | "elif a < b < c or c < b < a:\n",
|
546 | 546 | " print('Medium:', b)\n",
|
547 | 547 | "elif a < c < b or a < c < b: \n",
|
548 | 548 | " print('Medium:', c)\n",
|
549 | 549 | "else:\n",
|
550 |
| - " print('There equal numbers, try again')" |
| 550 | + " print('There are equal numbers, try again')" |
551 | 551 | ],
|
552 |
| - "execution_count": 5, |
| 552 | + "execution_count": 0, |
553 | 553 | "outputs": [
|
554 | 554 | {
|
555 | 555 | "output_type": "stream",
|
|
0 commit comments