Python Tutorial: List - Introduction

preview_player
Показать описание

#region Notes
"""
1. Heterogeneous Elements
2. Ordered sequence
4. Accessed by index
3. No bound on the size
5. Mutable
"""

# Return an element from the list at any given position.

# Insert an element at any position of the list.

# Remove the first occurrence of any element from a non-empty list.

# Remove the element at a specified location from a non-empty list.

# Replace an element at any position by another element.

# Return the number of elements in the list.

# Max elements in list

# Min elements in list

# Number of occurrence
#endregion

sentence="The rocket came back from mars"

for ele in sentence:
if ele in "aeiou":
print(ele)

vowels = [ele for ele in sentence if ele in "aeiou"]
print(vowels)
Рекомендации по теме