Basics Flashcards
What is a built on function?
- It is a function that is predefined and can be used firefly l directly.
What are comments in python?
Code that is ignored by python
Variables act as what?
Containers to store values
What is a shell script?
A set of commands to be executed in sequential order from the terminal
a list can store what ?
values of different types like numbers , strings , etc…
in a list what are is the position of a value called?
indexes
where do indexes start ?
0
if i have list list1=[2,4,5,6,7,2,] how would i access values 4,5,6?
a = list1[1:4] print(a)
how would i access all the items in the list ?
by using the colon as the argument .
what function would i use to add an item to the end of the list?
append()
if i want to delete items from a list what do i use?
del
where does del go w.r.t. the list variable?
before the list variable
what is another was to remove item other that del?
the remove() function
show an example of how to use the remove function
list1.remove(5), where the item at index 5 is being removed.
what is a tuple?
a data structure
what is another way to describe a tuple?
a sequence of items separated by commas 2
unlike lists tuples are what?
immutable
what does immutable mean?
something cannot be changed
what is a dictionary w.r.t. python?
it is a data structure which contains data in the form of pairs of keys and values .
what is a key usually ?
a string