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

A

a comma

22
Q

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

A

:

23
Q

items in a dictionary are accessed by what

A

their keys

24
Q

dictionaries are consider what?

A

unordered data structures

25
Q

to update an existing entry, w.r.t dictionaries, we need to first x the item and then y a new value to it

A

access , assign

26
Q

give an example of updating a dictionary entry

A

dict1[‘name’]= ‘abc’

27
Q
  • eIt is a function that is predefined and can be used firefly l directly.
A

What is a built on function?

28
Q

Code that is ignored by python

A

What are comments in python?

29
Q

Containers to store values

A

Variables act as what?

30
Q

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

A

What is a shell script?

31
Q

values of different types like numbers , strings , etc…

A

a list can store what ?

32
Q

indexes

A

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

33
Q

0

A

where do indexes start ?

34
Q

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

A

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

35
Q

by using the colon as the argument .

A

how would i access all the items in the list ?

36
Q

append()

A

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

37
Q

del

A

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

38
Q

before the list variable

A

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

39
Q

the remove() function

A

what is another was to remove item other that del?

40
Q

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

A

show an example of how to use the remove function

41
Q

a data structure

A

what is a tuple?

42
Q

a sequence of items separated by commas 2

A

what is another way to describe a tuple?

43
Q

immutable

A

unlike lists tuples are what?

44
Q

something cannot be changed

A

what does immutable mean?

45
Q

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

A

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

46
Q

a string

A

what is a key usually ?

47
Q

a comma

A

items in a dictionary are separated by what

48
Q

:

A

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

49
Q

their keys

A

items in a dictionary are accessed by what

50
Q

unordered data structures

A

dictionaries are consider what?

51
Q

access , assign

A

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
Q

dict1[‘name’]= ‘abc’

A

give an example of updating a dictionary entry