WEEK 6 2022 Flashcards

1
Q

What is the value that is assigned to the variable f in the given piece of python code?
i, f, str=50, 50.68, “Welcome to python”

A

50.68

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

What is the output of the following piece of python code?
x=’17’
y=’23’
z=x+y
print(z)

A

1723

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

Fill in the blanks. Raspbian is a/n ___________

A

Operating system

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

What is the output of the following piece of Python code?
t1 = ‘Welcome to python coding’
print(t1[8:14])

A

to pyt

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

Fill in the blanks. Raspberry Pi 3 Model B has a GPU support of _________

A

400 MHz video core IV

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

Which of the following represents the command used for rebooting Raspberry Pi?

A

sudo reboot

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

(T/F)It is not possible to return multiple values from a function in Python.

A

False

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

What is the data type of the variable ls in the following piece of Python code?
ls= {1: “item”, “key”: “21”, “year”: 2022}

A

dictionary

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

(T/F)A function in Python may or may not return a value

A

True

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

What are the basic modes to open a file in python?

A

All of these
[Read mode (r) and write mode (w) Append mode (a)
Both read and write mode (r+)]

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

What are the socket types that exist in Python based socket programming?

A

SOCK_DGRAM and SOCK_STREAM

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

(Y/N)Does Python support exception handling?

A

Yes

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

Which of the following must be used to terminate a loop and move to the next code after the loop?

A

break

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

Select the option that does not represent a keyword in Python language?
a. while
b. if
c. try
d. integer

A

integer

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

(T/F)Raspberry Pi does not support any other language other than Python?

A

False

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