Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Measuring and Managing List Size in Python | Section
Python Data Structures
セクション 1.  4
single

single

bookMeasuring and Managing List Size in Python

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

When working with large or complex lists, knowing how many elements they contain is often useful. Python provides the len() function, which returns the total number of items in a list.

Note
Note

A nested list is considered a single item. The len() function doesn't count the individual items inside a nested list as separate items of the main list.

12345
cities_list = ["Tokyo", "New York", "Sydney", "Berlin", ["Paris", "France"]] list_length = len(cities_list) print(list_length)
copy
タスク

スワイプしてコーディングを開始

Find out how many cities are in the travel_wishlist.

  • Assign the value of the length of the travel_wishlist list to the variable list_length.
  • Use the len function to find a length.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

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

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

セクション 1.  4
single

single

AIに質問する

expand

AIに質問する

ChatGPT

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

some-alt