Write the output of the following.
(a) string1 = ‘Rainbow’ print(list(string1))
Answer:
Output: ['R', 'a', 'i', 'n', 'b', 'o', 'w']
Explanation:
The list method takes the string ‘Rainbow’ and converts it into a list data type by splitting the string and making each character into a list element.
Learn in your speed, with individual attention - Teachoo Maths 1-on-1 Class