Arithmetic practice and strings
Answers are for parents and teachers.
1
If s = "BUXORO", find s[1:4].
UXO
2
Write one line of code that prints a line made of 20 dashes (-).
print("-" * 20)
3
Find the sum of the digits of the three-digit number 859 using // and %.
22
4
How many hours, minutes and seconds is 3725 seconds? Write the answer.
1 hour 2 minutes 5 seconds
5
Why is len("ab cd") equal to 5 and not 4?
A space also counts as a character.