Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Work with Strings | Introduction to Python 1/2
Introduction to Python for Data Analysis

bookWork with Strings

メニューを表示するにはスワイプしてください

Strings are the standard way to store text. We can use it for storing users' emails, names, etc. You can keep it in different ways.

  • The first way is:
12
string = 'Strings are easy' print(string)
copy
  • The second way is:
12
string = "Strings are easy" print(string)
copy
  • The third way is:
1234
string = ''' Strings are easy ''' print(string)
copy
  • The fourth way is:
1234
string = """ Strings are easy """ print(string)
copy

The first two ways are the most common, and the third and the fourth are used for storing several lines of code.

If you want to put a quotation mark inside the quotes, you can put an ordinary quotation mark inside a double one or vice versa.

1234
string_1 = "I've never learned Python" string_2 = 'I"ve never learned Python' print(string_1) print(string_2)
copy
question mark

Choose the INCORRECT ways to define the string.

すべての正しい答えを選択

すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 1.  11

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

セクション 1.  11
some-alt