Найти в Дзене
Lesson 1. Tasks
Task 1. Enter any real number. Program returns integer and fractional parts of that number. Example: In [1]: 7.89 Out [1]: 7 0.89 Task 2. Enter any integer number. Program returns last numeral of that number. Example: In [1]: 987 Out [1]: 7 Task 3. Enter two numbers: h - hour (0 - 23) delta - some addition (>0) Program calculates how many hours will be after (h + delta). If h == 22 and delta == 1, result will be equal 23. In case, delta == 3, result will be equal 1. Example: In [1]: 20 In [2]: 10 Out [1]: 6 Task 4...
2 года назад
Lesson 1. Introduction in Python
#PYTHON  #INTRODUCTION IN PYTHON #aRithmetic operators #data types #conversion of types #built-in functions #variables Arithmetic operators · Addition: + · Subtraction: - · Multiplication: * · Division: / · Floor division: // · Modulus: % · Exponent: ** Data types · Integer numbers – int: …, -5, -4, -3, -2, -1, 0, 1, … · Floating-point numbers – float: …, -1.1, 5.16, 3e-10, … · String – str: …, «S», «LINUX», «3ABoP», «Hello, World!», … · Boolean type – bool: False, True · Nothing – NoneType: None Conversion of types · int to float in [1]: float(1) out [1]: 1.0 · float to int in [2]: int(5.7) out [2]: 5 · float to str in [3]: str(54...
2 года назад