PYTHON PROGRAMMING LAB Exp 5

Publicado el: 09 enero 2024
en el canal de: DIWAKAR TIWARY
63
1

Exp 5 Program to create, append, and remove lists in python.
SOURCE CODE:
my_list = ['ANMOL','CLASSES','WELCOMES','YOU','IN','PYTHON','PROGRAMMING']
print(my_list)
Output: ['ANMOL', 'CLASSES', 'WELCOMES', 'YOU', 'IN', 'PYTHON', 'PROGRAMMING']
my_list.append("LAB")
print(my_list)
Output: ['ANMOL', 'CLASSES', 'WELCOMES', 'YOU', 'IN', 'PYTHON', 'PROGRAMMING', 'LAB']
my_list.remove('ANMOL')
print(my_list)
Output: ['CLASSES', 'WELCOMES', 'YOU', 'IN', 'PYTHON', 'PROGRAMMING', 'LAB']
print(my_list.pop(1))
Output: WELCOMES
print(my_list)
Output: ['CLASSES', 'YOU', 'IN', 'PYTHON', 'PROGRAMMING', 'LAB']
print(my_list.pop())
Output: LAB
print(my_list)
Output: ['CLASSES', 'YOU', 'IN', 'PYTHON', 'PROGRAMMING']
my_list.clear()
print(my_list)
Output: []

INPUT AND OUTPUT:
['ANMOL', 'CLASSES', 'WELCOMES', 'YOU', 'IN', 'PYTHON', 'PROGRAMMING']
['ANMOL', 'CLASSES', 'WELCOMES', 'YOU', 'IN', 'PYTHON', 'PROGRAMMING', 'LAB']
['CLASSES', 'WELCOMES', 'YOU', 'IN', 'PYTHON', 'PROGRAMMING', 'LAB']
WELCOMES
['CLASSES', 'YOU', 'IN', 'PYTHON', 'PROGRAMMING', 'LAB']
LAB
['CLASSES', 'YOU', 'IN', 'PYTHON', 'PROGRAMMING']
[]


En esta página del sitio puede ver el video en línea PYTHON PROGRAMMING LAB Exp 5 de Duración hora minuto segunda en buena calidad , que subió el usuario DIWAKAR TIWARY 09 enero 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 63 veces y le gustó 1 a los espectadores. Disfruta viendo!