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
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