Test Practice Flashcards

1
Q

What is the output of the following code?

a , b = 10 , 20
print( (b , a)[a < b] )

A

10

a < b evaluates to True

True = 1

So, the 1 index of the tuple (b, a) is a, which is set to the value of 10

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

UTF-8

A

1 - can handle any Unicode point

2 - is a type of encoding

3 - the 8 in UTF-8 means 8-bit values are used in encoding

4 - it can handle any Unicode code point

5 - ASCII characters are also valid UTF-8 text

6 - stands for Unicode transformation format

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