Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Concatenation | Variables and Types
Introduction to Python

ConcatenationConcatenation

Let's dive into concatenation. This process simply joins two strings together. In Python, you can concatenate two strings using the + operator, much like you'd add numbers.

Note

Concatenation won't automatically insert spaces between the strings you're joining.

For instance, you can combine words with an article:

Note

Keep in mind, you can only concatenate strings with other strings. In other words, you can't directly concatenate a word like 'word' with a number such as 1. To achieve this, first convert the number to a string using the str(1) function, and then concatenate.

What result will the following code produce?

Виберіть правильну відповідь

Все було зрозуміло?

Секція 2. Розділ 12
course content

Зміст курсу

Introduction to Python

ConcatenationConcatenation

Let's dive into concatenation. This process simply joins two strings together. In Python, you can concatenate two strings using the + operator, much like you'd add numbers.

Note

Concatenation won't automatically insert spaces between the strings you're joining.

For instance, you can combine words with an article:

Note

Keep in mind, you can only concatenate strings with other strings. In other words, you can't directly concatenate a word like 'word' with a number such as 1. To achieve this, first convert the number to a string using the str(1) function, and then concatenate.

What result will the following code produce?

Виберіть правильну відповідь

Все було зрозуміло?

Секція 2. Розділ 12
some-alt