Show the result of evaluating each of the following string expressions.

computer science

Description

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


Related Questions in computer science category