Please help me! Помогите! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please help me! Помогите!

что делает команда str я не понял а также как работает знак % на языке python. what does the str command do not understand and how the% sign works in the language python

8th Nov 2017, 6:43 PM
Vita
2 Answers
+ 4
str is short for string. str is a python class. You can use str() to create a new string or convert an object into a string. I.E. str(42) returns a string representation of the int 42 as "42". https://docs.python.org/3.6/library/stdtypes.html?highlight=str#str % is the modulus operator. It is used to get the remainder of division. I.E. 10/3 = 3 with a remainder of 1 so; 10%3 = 1
8th Nov 2017, 6:55 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
Str конвертирует в строковый тип или создаёт новую строку. % по простому это остаток от деления.
2nd Sep 2019, 10:49 PM
Marat Semenov
Marat Semenov - avatar