Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Multiline Strings | Data Types
Introduction to Data Analysis in Python
course content

Kurssisisältö

Introduction to Data Analysis in Python

Introduction to Data Analysis in Python

1. Basics
2. Data Types
3. Control Flow
4. Functions and Modules
5. Introduction to NumPy

book
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.

123456789
string_1 = ''' Strings are easy ''' # or string_2 = 'Strings\nare easy' print(string_1) print(string_2)
copy
question mark

How many lines will be output after the code execution?

Select the correct answer

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 4

Kysy tekoälyä

expand
ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

course content

Kurssisisältö

Introduction to Data Analysis in Python

Introduction to Data Analysis in Python

1. Basics
2. Data Types
3. Control Flow
4. Functions and Modules
5. Introduction to NumPy

book
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.

123456789
string_1 = ''' Strings are easy ''' # or string_2 = 'Strings\nare easy' print(string_1) print(string_2)
copy
question mark

How many lines will be output after the code execution?

Select the correct answer

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 4
Pahoittelemme, että jotain meni pieleen. Mitä tapahtui?
some-alt