In this program, we will check the input type from the user and perform actions according to it.
Steps to solve the program
- Take input from the user and create an empty list.
- If the type of input is a string then add it to the empty list using for loop.
- Print the output.
data = input("Enter your text: ")
List = []
if type(data) == str:
for char in data:
List.append(char)
print(List)
Output :
Enter your text: sqatools007
['s', 'q', 'a', 't', 'o', 'o', 'l', 's', '0', '0', '7']