Multiline Strings
If you need to store more than 1 line of text within one variable, you will need to enclose it with a pair of Triple quotes.
Another option is to use the newline characters (\n
). In this case, you will not need to use pair of Triple quotes.
123456789string_1 = ''' Strings are easy ''' # or string_2 = 'Strings\nare easy' print(string_1) print(string_2)
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 2. Розділ 4
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Awesome!
Completion rate improved to 2.7
Multiline Strings
Свайпніть щоб показати меню
If you need to store more than 1 line of text within one variable, you will need to enclose it with a pair of Triple quotes.
Another option is to use the newline characters (\n
). In this case, you will not need to use pair of Triple quotes.
123456789string_1 = ''' Strings are easy ''' # or string_2 = 'Strings\nare easy' print(string_1) print(string_2)
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 2. Розділ 4