#6.1 Numeric Data Types. Generation Python Course for Beginners Part 1

Publicado em: 01 Janeiro 1970
no canal de: Информатика и ИКТ
8,969
162

Course analysis on stepik.org Generation Python course for beginners. Topic: Numeric data, Integer data type, Converting a string to an integer, Integer operators, Long arithmetic, Separator character, Floating-point numbers, Converting a string to a floating-point number, Arithmetic operators, Converting between int and float.

Task #1
Write a program that reads the lengths of two legs of a right triangle and outputs its area.

Input data format
The program receives two floating-point numbers - the lengths of the legs, each on a separate line.

Output data format
The program should output one number - the area of ​​the triangle.

Task #2
Two cars
Two cars are traveling towards each other at constant speeds of V1 V2 km/h. Determine how long it will take for the cars to meet if the distance between them is S km.

Input data format
The program receives three floating-point numbers, each on a separate line.

Output data format
The program must output one number in accordance with the problem statement.

Problem #3
Reciprocal number
Write a program that reads one number from the keyboard and outputs its reciprocal. If the number entered from the keyboard is zero, then output "There is no reciprocal number" (without quotes).

Input data format
The program receives one real number as input.

Output data format
The program must output a real number that is the reciprocal of the given number, or text in accordance with the problem statement.

Problem #4
451 degrees Fahrenheit
The famous American writer Ray Bradbury has a novel called "451 degrees Fahrenheit". Write a program that determines what temperature on the Celsius scale corresponds to the specified value on the Fahrenheit scale.

Input data format
The program receives a real number of degrees Fahrenheit as input.

Output data format
The program should output the number of degrees Celsius.

Task #5
Dog age
The program receives the number nn, the number of dog years. Write a program that calculates the dog's age in human years.

Input data format
The program receives a natural number, the number of dog years, as input.

Output data format
The program should output the dog's age in human years.

Note. For the first two years, a dog year is equal to 10.5 human years. After that, each dog year is equal to 4 human years.

Task #6
First digit after the decimal point
You are given a positive real number. Output its first digit after the decimal point.

Input data format
The program receives a positive real number as input.

Output data format
The program must output a number in accordance with the problem statement.

Problem #7
Fractional part
A positive real number is given. Output its fractional part.

Input data format
A positive real number is fed to the program as input.

Output data format
The program must output the fractional part of the number in accordance with the problem statement.

#python #stepik


Nesta página do site você pode assistir ao vídeo on-line #6.1 Numeric Data Types. Generation Python Course for Beginners Part 1 duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Информатика и ИКТ 01 Janeiro 1970, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 8,969 vezes e gostou 162 espectadores. Boa visualização!