Sample
Sample
print("\nMenu:")
print("11. Exit")
while True:
if choice == 1:
list.append(element)
elif choice == 2:
list.extend(eval(new_list))
elif choice == 3:
list.insert(index, element)
elif choice == 4:
list.remove(element)
elif choice == 5:
del list[index]
else:
elif choice == 6:
count = list.count(element)
print(count)
elif choice == 7:
index = list.index(element)
elif choice == 8:
list.sort()
elif choice == 9:
list.reverse()
print(list)
break
else:
print("\nMenu:")
print("5. Exit")
while True:
if choice == 1:
element = sample_tuple[index]
print(element)
else:
elif choice == 2:
count = sample_tuple.count(element)
print(count)
elif choice == 3:
index = sample_tuple.index(element)
print(index)
elif choice == 4:
print(sample_tuple)
elif choice == 5:
break
else:
print("\nMenu:")
print("7. Exit")
while True:
if choice == 1:
length = len(string)
print(length)
elif choice == 2:
uppercase_string = string.upper()
print(uppercase_string)
elif choice == 3:
lowercase_string = string.lower()
print(lowercase_string)
elif choice == 4:
capitalized_string = string.capitalize()
print(capitalized_string)
elif choice == 5:
count = string.count(substring)
print(count)
elif choice == 6:
print(string)
elif choice == 7:
break
else: