Basics Flashcards

1
Q

What is a built on function?

A
  • It is a function that is predefined and can be used firefly l directly.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are comments in python?

A

Code that is ignored by python

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Variables act as what?

A

Containers to store values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a shell script?

A

A set of commands to be executed in sequential order from the terminal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

a list can store what ?

A

values of different types like numbers , strings , etc…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

in a list what are is the position of a value called?

A

indexes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

where do indexes start ?

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

if i have list list1=[2,4,5,6,7,2,] how would i access values 4,5,6?

A

a = list1[1:4] print(a)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how would i access all the items in the list ?

A

by using the colon as the argument .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what function would i use to add an item to the end of the list?

A

append()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

if i want to delete items from a list what do i use?

A

del

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

where does del go w.r.t. the list variable?

A

before the list variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is another was to remove item other that del?

A

the remove() function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

show an example of how to use the remove function

A

list1.remove(5), where the item at index 5 is being removed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is a tuple?

A

a data structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is another way to describe a tuple?

A

a sequence of items separated by commas 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

unlike lists tuples are what?

A

immutable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

what does immutable mean?

A

something cannot be changed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

what is a dictionary w.r.t. python?

A

it is a data structure which contains data in the form of pairs of keys and values .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

what is a key usually ?

A

a string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

items in a dictionary are separated by what

22
Q

w.r.t. dictionaries the key and value are separated by what?

23
Q

items in a dictionary are accessed by what

A

their keys

24
Q

dictionaries are consider what?

A

unordered data structures

25
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
26
give an example of updating a dictionary entry
dict1['name']= 'abc'
27
* eIt is a function that is predefined and can be used firefly l directly.
What is a built on function?
28
Code that is ignored by python
What are comments in python?
29
Containers to store values
Variables act as what?
30
A set of commands to be executed in sequential order from the terminal
What is a shell script?
31
values of different types like numbers , strings , etc...
a list can store what ?
32
indexes
in a list what are is the position of a value called?
33
0
where do indexes start ?
34
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?
35
by using the colon as the argument .
how would i access all the items in the list ?
36
append()
what function would i use to add an item to the end of the list?
37
del
if i want to delete items from a list what do i use?
38
before the list variable
where does del go w.r.t. the list variable?
39
the remove() function
what is another was to remove item other that del?
40
list1.remove(5), where the item at index 5 is being removed.
show an example of how to use the remove function
41
a data structure
what is a tuple?
42
a sequence of items separated by commas 2
what is another way to describe a tuple?
43
immutable
unlike lists tuples are what?
44
something cannot be changed
what does immutable mean?
45
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?
46
a string
what is a key usually ?
47
a comma
items in a dictionary are separated by what
48
:
w.r.t. dictionaries the key and value are separated by what?
49
their keys
items in a dictionary are accessed by what
50
unordered data structures
dictionaries are consider what?
51
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
52
dict1['name']= 'abc'
give an example of updating a dictionary entry