I have a list which looks something like this:
[\'1\', \'2\', \'3.4\', \'5.6\', \'7.8\']
How do I change the first two to int
If you want to display as the same list append the list by using the following query:
item = input("Enter your Item to the List: ")
shopList.append(int(item) if item.isdigit() else float(item))
Here when the user enters int values or float values it appends the list shopList and stores these values in it.