セクション 1. 章 18
single
Merging Immutable Sequences in Python
メニューを表示するにはスワイプしてください
In Python, it's possible to combine tuples. This involves forming a new tuple by merging two or more existing ones. You can accomplish this with the + operator. Here's an example to illustrate.
1234567movie_titles = ("Inception", "Interstellar", "Dunkirk") release_years = (2010, 2014, 2017) # Concatenate the tuples combined_tuple = movie_titles + release_years print(combined_tuple)
タスク
スワイプしてコーディングを開始
You are given: the tuple space_movies and the list new_movies.
- Convert the list into a tuple and assign the result to the variable
animal_movies. - Use the
tuplefunction to complete the first step. - Concatenate the two tuples and assign the result to the variable
movie_poster.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 18
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください