String - A string is a sequence of characters enclosed in single (' '), double (" "), or triple (''' or """) quotes. In Python, strings are used for text and can be manipulated in various ways., Indexing - Indexing refers to accessing individual characters in a string or elements in a sequence (e.g., a list) by their position. In Python, indexing starts at 0, String Concatenation - String concatenation is the process of combining two or more strings to create a new string. It can be done using the + operator., String Slicing - String slicing allows you to extract a portion of a string by specifying a range of indices. It is done using square brackets and colons, like string[start:end]., String Length - The length of a string is the number of characters it contains. You can find the length of a string using the len() function., String Functions - There are built-in functions in Python that allow you to perform various operations on strings, such as converting to uppercase, lowercasing, and searching for substrings., 1D Array (List) - A 1D array in Python is also known as a list. Unlike a Python List, an array is a collection of elements that are of the same data type. Arrays and Lists are stored in a linear sequence and accessed using indices., Array Indexing - Array indexing allows you to access individual elements in a list by their position. Similar to strings, list indexing starts at 0., Array Length - The length of an array is the number of elements it contains. You can find the length of a list using the len() function., Append - The append() function is used to add an element to the end of a list. It is commonly used to build lists dynamically., Iterating an array or string - Iteration is the process of looping through the elements of a string or a list. It allows you to perform actions on each element one at a time., String vs. List - Strings and lists are both sequences in Python, but strings contain characters, while lists can contain elements of various data types. Understanding the differences between them is important for effective programming.,
0%
N5 Revision - Strings and 1D arrays
共有
共有
共有
Mrscalderwood
さんの投稿です
コンテンツの編集
印刷
埋め込み
もっと見る
割り当て
リーダーボード
フラッシュカード
は自由形式のテンプレートです。リーダーボード用のスコアは生成されません。
ログインが必要です
表示スタイル
フォント
サブスクリプションが必要です
オプション
テンプレートを切り替える
すべてを表示
アクティビティを再生すると、より多くのフォーマットが表示されます。
オープン結果
リンクをコピー
QRコード
削除
自動保存:
を復元しますか?