CBSE Class 12 Computer Science Question 90 of 120

Review of Python Basics — Question 42

Back to all questions
42
Question

Question 37

Write a Python program to convert a string to a list.

Solution
string = input("Enter the string: ")
char_list = list(string)

print("String converted to list:", char_list)
Output
String converted to list: ['P', 'y', 't', 'h', 'o', 'n']
Answer