#Python string #code & sober | concatenation vs replication | strengthen your programming skills

preview_player
Показать описание
The meaning of an operator may change based on the data types of the
values next to it. For example, + is the addition operator when it operates on
two integers or floating-point values. However, when + is used on two string
values, it joins the strings as the string concatenation operator. Enter the following
into the interactive shell

The expression evaluates down to a single, new string value that combines
the text of the two strings. However, if you try to use the + operator on
a string and an integer value, Python will not know how to handle this, and
it will display an error message.

TypeError: can't multiply sequence by non-int of type 'float'
Рекомендации по теме
join shbcf.ru