Computer Science
Write a Python program to convert a string to a list.
Python
Python List Manipulation
1 Like
Answer
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']
Answered By
1 Like
Related Questions
Write a Python program to generate and print a list of first and last 5 elements where the values are square of numbers between 1 and 30 (both included).
Write a Python program to get unique values from a list.
Write a Python script to concatenate the following dictionaries to create a new one:
d1 = {'A': 1, 'B': 2, 'C': 3} d2 = {'D': 4 }
Output should be:
{'A': 1, 'B': 2, 'C': 3, 'D' : 4}
Write a Python script to check if a given key already exists in a dictionary.