python_math_stat/practica/stepik/stepik_tasks/README.md

3.7 KiB
Raw Blame History

Stepik tasks

Here you can find done tasks from stepik courses.

  • 10_pass_100_break

    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

    A program that reads numbers from input and after the first zero entered, prints the sum of the received numbers

  • Intervals

    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

    • #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

    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

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 программистов
  • Sapper game

    The program that accepts as input : number of rows, columns and bombs and outputs the table where:

    1. numbers - the count of bombs nerby and also diagonally within 1 cell
    2. '*' - bombs
    3. '.' - there are not bombs nearby this cell

Plan of solution:

  1. create a two-dimensional list
  2. fill the cells with zeros
  3. -1 - bombs, fill the bombs into the cells according to the coordinates, fill in the numbers depending on the location of the bombs
  4. coordinates i(row number) -1 j(column number)-1, di dj \ i+di\ j + dj\ di dj -1..1
  • Sum_num_from_last

    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

    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

  • Sum of squared numbers A program reads numbers from the console (one per line) until their sum is equal to 0. Then it displays the sum of the squares of these numbers.

  • Tickets

    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