Unit 3.1-3.2 Hacks
name = "amay"
age = "16"
print(name + " is " + age)
Nathan Hacks
1) Lists are used to store multiple items in a single variable. Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuple, Set, and Dictionary, all with different qualities and usage.
2) The term element is used in computing to refer to a smaller component of a larger system. In computer programming, an array is a stored list of individual elements or pieces of data.
3) index
4) string = ["amay", "alex"]
num1=input("Input a number. ")
num2=input("Input a number. ")
num3=input("Input a number. ")
add=input("How much would you like to add? ")
# Add code in the space below
numlist = [int(num1), int(num2), int(num3)]
# The following is the code that adds the inputted addend to the other numbers. It is hidden from the user.
for i in range(len(numlist)):
numlist[i-1] += int(add)
print(numlist)
food1 = "pizza"
food2 = "hot dog"
food3 = "sushi"
food4 = "strawberry"
food5 = "sandwich"
print(food1, food2, food3, food4, food5)
foods = ["pizza", "hot dog", "sushi", 'strawberry', 'sandwich']
print(foods)