Computer Science
What happens when from a string slice you skip the start and/or end values of the slice?
Related Questions
Given a string S = "CARPE DIEM". If n is length/2 (length is the length of the given string), then what would following return?
(a) S[: n]
(b) S[n :]
(c) S[n : n]
(d) S[1 : n]
(e) S[n : length - 1]From the string S = "CARPE DIEM", which ranges return "DIE" and "CAR"?
What would the following expressions return?
- "Hello World".upper( ).lower( )
- "Hello World".lower( ).upper( )
- "Hello World".find("Wor", 1, 6)
- "Hello World".find("Wor")
- "Hello World".find("wor")
- "Hello World".isalpha( )
- "Hello World".isalnum( )
- "1234".isdigit( )
- "123FGH".isdigit( )
Which functions would you choose to use to remove leading and trailing white spaces from a given string?