Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Python by --------------- ( 5 years ago )
#Consider the following tuple:
genres_tuple = ("pop", "rock", "soul", "hard rock", "soft rock", \
                "R&B", "progressive rock", "disco")
genres_tuple

# 1. Find the length of the tuple, genres_tuple
len(genres_tuple)

# 2. Access the element, with respect to index 3
print(genres_tuple[3])

# 3. Use slicing to obtain indexes 3, 4 and 5
genres_tuple[3:6]

# 4. Find the first two elements of the tuple genres_tuple
genres_tuple[0:2]

# 5. Find the first index of "disco"
genres_tuple.index("disco")

# 6. Generate a sorted List from the Tuple C_tuple=(-5, 1, -3)
C_tuple=(-5, 1, -3)
C_list = sorted(C_tuple)
C_list

 

Revise this Paste

Your Name: Code Language: