I want to remove the quotes from the variable average. Here is my code:
list_1 = ['LIST: ']
list_2 = [['Mary Smith', 132, 'Jean Jones', 156, 'Karen Karter', 167]]
list_3 = ['Mary Smith', 132, 'Jean Jones', 156, 'Karen Karter', 167]
combine = (str(list_1)[2:-2]) + (str(list_2)[1:-1])
print(combine)
new_list = input("Name to add to the list: ")
average = input("Average: ")
list_3.append(new_list)
list_3.append(average)
print(f"UPDATED LIST: {list_3}")
print("There are now {0} items".format(len(list_3)), "in the list")
Here is what I want to come out:
LIST: ['Mary Smith', 132, 'Jean Jones', 156, 'Karen Karter', 167]
Name to add to the list: Ann Kert
Average: 189
UPDATED LIST: ['Mary Smith', 132, 'Jean Jones', 156, 'Karen Karter', 167, 'Ann Kert', 189]
There are now 8 items in the list
But here is what I got:
LIST: ['Mary Smith', 132, 'Jean Jones', 156, 'Karen Karter', 167]
Name to add to the list: Ann Kert
Average: 189
UPDATED LIST: ['Mary Smith', 132, 'Jean Jones', 156, 'Karen Karter', 167, 'Ann Kert', '189']
There are now 8 items in the list
If you don't see the difference then the difference is the 189 needs to have no qoutes but the thing that I got is '189'