I am trying to take input from user something like this: [[1,2,3], 4, 5]. in which [1,2,3] in list type and 4 and 5 in int type.
how can I do this by input method?
here is my code but in which everything is in string type.
in_list = input("Enter your list :- ").split()
print(in_list)
print(type(in_list[0]))
print(type(in_list[1]))
output:-
Enter your list :- 1,2,3 4 5
['1,2,3', '4', '5']
class 'str'
class 'str'