Computer Science

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]

Python String Manipulation

38 Likes

Answer

(a) CARPE
(b) DIEM
(c) (Empty String)
(d) ARPE
(e) DIE

Answered By

16 Likes


Related Questions