Quiz

Check your understanding of text values in Python by doing the next short quiz and tasks:

Which of the statements is faulty?

s = ‘a’ + “b”

s = ‘ab”

s = ‘ab’

Which statement prints `` tra-la-la ‘’? (Mark all correct answers)

print(‘tra’ + 2 * ‘-la’)

print(‘tra-’ + 2 * ‘la-‘)

print(‘tra-’ + ‘la-’ + ‘la’)

print(‘tra-’ + ‘la-la’)

print(‘tra-la-’ + ‘-la’)

What does the statement print((‘N’ + ‘A’) * 2) print?
|blank|

Task - Profit Sharing

Three friends agreed to divide the profits from a joint venture so that the first would get 2/7 of the earnings, the second 1/3, and the third would get the remaining sum. The total profit was 40000. Complete the program, which will print, in two decimal places, the earnings of each of the three friends.