Learning Python - Part 3 - Comments
https://steemit.com/steemiteducation/@pentest1002/learning-python-part-3-comments
Learning Python - Part 2 - Declaring Variables and understanding strings
https://steemit.com/programming/@pentest1002/learning-python-part-2-declaring-variables-and-understanding-strings
Learning Python - Part 1 - Familiarise yourself with the Python Console and write your first Python program!
https://steemit.com/programming/@pentest1002/learning-python-part-1-familiarise-yourself-with-the-python-console-and-write-your-first-python-program
For example:
names = ['james', 'connor', 'jacob', 'bella']
print(names)The output will be:
['james', 'connor', 'jacob', 'bella']
names = ['james', 'connor', 'jacob', 'bella']
print(name[0])james
Lists start from 0, so james is 0, connor is 1, jacob is 2, bella is 3.
You can also use strings methods on lists, for example:
names = ['james', 'connor', 'jacob', 'bella']
print(names[0].title())James
Python has a special syntax for accessing the last item.
names = ['james', 'connor', 'jacob', 'bella']
print(names[-1])bella
If this post helped you, don't forget to upvote and comment if you have a question!
See you in the next Post!