PYTHON Midterm: 5List in python

4 views2 pages
25 May 2023
Department
Course
Professor

Document Summary

#5 python tutorial for beginners | list in python. In this paper, we will be discussing how to work with lists in python. A list is a collection of different values, such as numbers and strings, grouped together. To create a list, we use square brackets to enclose the values we want to include. For example: nums = [25, 12, 636, 95, 14] We can then print the list by typing nums. We can also access individual values within the list using their index number, starting from 0. This would print out the first value in the list, which is 25. We can also access values from the end of the list using negative index numbers. This would print out the last value in the list, which is 14. One of the great things about lists is that they can contain different types of data. For example, we can create a list like this: values = [9. 5, "my name", 25]

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related Documents

Related Questions