-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistrev05.py
36 lines (24 loc) · 871 Bytes
/
listrev05.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/python3
"""Learning or Reviewing about Lists | by Alta3 Research"""
def main():
## a list of Alta3 classes
alta3classes = ['python_basics', 'python_api_design', 'python_for_networking', 'kubernetes', \
'sip', 'ims', '5g', '4g', 'avaya', 'ansible', 'python_and_ansible_for_network_automation']
## display the list
print(alta3classes)
## how long is the list? use the built in len function
## THEN print (display) the results
print(len(alta3classes))
# display python_basics
print(alta3classes[0])
# display SIP
print(alta3classes[4])
# display Ansible
print(alta3classes[9])
##Uncomment to see a list index out of range error
#print(alta3classes[99])
print(alta3classes[0:3])
print("test", alta3classes[5:5])
print(alta3classes[-1])
if __name__ == "__main__":
main()