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)
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 2. Kapitel 4
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Suggested prompts:
Ställ mig frågor om detta ämne
Sammanfatta detta kapitel
Visa verkliga exempel
Awesome!
Completion rate improved to 2.7
Multiline Strings
Svep för att visa menyn
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)
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 2. Kapitel 4