Quiz 1 Flashcards

1
Q

Algorithm is defined as an infinite sequence of instructions.

True
False

A

F

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

All collections are indexed and ordered.
True
False

A

F

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

Data are stored in computers as characters.
True
False

A

F

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

Data structures make it easy for users to access and work with the data they need in appropriate ways
True
False

A

T

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

Collections is a user-define functions in python module that provides useful container datatypes
True
False

A

F

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

What kind of collection is A= [3,6,8,9,2]?

dictionary
tuple
list
set

A

list

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

All methods and functions is applicable to tuples only.
True
False

A

F

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

Tuples are written with ____
()
{}
[]

A

()

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

The way to declare a set collection is as follows:

set={ “a”:2,”b”:1}

True
False

A

F

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

You cannot add items to a Lists once it is created.
True
False

A

F

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

You can use the mode “r” to read and write in a text file.
True
False

A

F

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

The process mode w+ and a+ are the same.
True
False

A

F

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

The b mode in file handling is used for binary only.

True
False

A

T

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

The key function for working files in Python is the write () function

True
False

A

F

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

The mode “r+”, indicated both read and write.

True
False

A

T

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

The read() function is used to read a part of the text file.

True
False

A

F

17
Q

An empty dictionary without any items is written with just ()

True
False

A

F

18
Q

Keys/keynames are unique within a dictionary while values may not be.

True
False

A

T

19
Q

Changing the value of a specific item in a dictionary be referring to its key value.

True
False

A

F

20
Q
Choose two ways to formulate a good algorithm.
  design patterns 
  abstract structure 
  data analysis 
  Data structure
A

Data structure

design patterns