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
items in a dictionary are separated by what
a comma
w.r.t. dictionaries the key and value are separated by what?
:
items in a dictionary are accessed by what
their keys
dictionaries are consider what?
unordered data structures
to update an existing entry, w.r.t dictionaries, we need to first x the item and then y a new value to it
access , assign
give an example of updating a dictionary entry
dict1[‘name’]= ‘abc’
- eIt is a function that is predefined and can be used firefly l directly.
What is a built on function?
Code that is ignored by python
What are comments in python?
Containers to store values
Variables act as what?
A set of commands to be executed in sequential order from the terminal
What is a shell script?
values of different types like numbers , strings , etc…
a list can store what ?
indexes
in a list what are is the position of a value called?
0
where do indexes start ?
a = list1[1:4] print(a)
if i have list list1=[2,4,5,6,7,2,] how would i access values 4,5,6?
by using the colon as the argument .
how would i access all the items in the list ?
append()
what function would i use to add an item to the end of the list?
del
if i want to delete items from a list what do i use?
before the list variable
where does del go w.r.t. the list variable?
the remove() function
what is another was to remove item other that del?
list1.remove(5), where the item at index 5 is being removed.
show an example of how to use the remove function
a data structure
what is a tuple?
a sequence of items separated by commas 2
what is another way to describe a tuple?
immutable
unlike lists tuples are what?
something cannot be changed
what does immutable mean?
it is a data structure which contains data in the form of pairs of keys and values .
what is a dictionary w.r.t. python?
a string
what is a key usually ?
a comma
items in a dictionary are separated by what
:
w.r.t. dictionaries the key and value are separated by what?
their keys
items in a dictionary are accessed by what
unordered data structures
dictionaries are consider what?
access , assign
to update an existing entry, w.r.t dictionaries, we need to first x the item and then y a new value to it
dict1[‘name’]= ‘abc’
give an example of updating a dictionary entry