import numpy as np
numbers = np.array([10, 20, 30])
for i in numbers:
    print(i)
10
20
30
inventory = ["flour", "milk", "sugar", "eggs", "vanilla", "salt"]
print(inventory)
print(inventory[1])
inventory.append("banana")
inventory.insert(2, "grapes")
inventory.remove("eggs")
print(inventory)
print(inventory.pop(5))
print(inventory)
inventory.pop(5)
['flour', 'milk', 'sugar', 'eggs', 'vanilla', 'salt']
milk
['flour', 'milk', 'grapes', 'sugar', 'vanilla', 'salt', 'banana']
salt
['flour', 'milk', 'grapes', 'sugar', 'vanilla', 'banana']





'banana'
names = ["ravi", "sushant", "shriya"]
names2 = ["john", "sophie", "gayathri","kate"]
namelengths = []
for name in names:
    namelength = len(name)
    namelengths.append(namelength)
print(namelengths)

def itemlengths(itemlist):
    itemlengthlist = []
    for item in itemlist:
        itemlengthlist.append(len(item))
    return itemlengthlist
print(itemlengths(names))
print(itemlengths(names2))


[4, 7, 6]
[4, 7, 6]
[4, 6, 8, 4]
"write a function that when it takes in a list of items, it returns a list that is just the first letter of each word"
"and another function that takes a list of strings and it should reverse that list"
words1 = ["happy", "birthday", "to", "you"]
def firstletter(words):
    wordlist = []
    for word in words:
        wordlist.append(word[0])
    return wordlist
print(firstletter(words1))
['h', 'b', 't', 'y']