1. Given the initial statements: s1 - "spam" s2 - "ni!" Show the result of evaluating each of the following string expressions. a) "The Knights who say," + s2 b) 3 * s1 + 2 * s2 c) s1[1] d) s1[1 : 3] e) s1[2] + s2[ : 2] f) s1 + s2[ -1] g) s1.upper() h) s2.upper().ljust(4)*3
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |