Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.16 KB

File metadata and controls

36 lines (27 loc) · 1.16 KB

python-arrayCollections-cw

Problem 1:

Create a function with the variable below. After you create the variable do the instructions below that.

arrayForProblem2 = ["Kenn", "Kevin", "Erin", "Meka"]

a) Print the 3rd element of the numberList.

b) Print the size of the array

c) Delete the second element.

d) Print the 3rd element.

Problem 2:

We will keep having this problem until EVERYONE gets it right without help

Create a function that has a loop that quits with ‘q’. If the user doesn't enter 'q', ask them to input another string.

Problem 3:

Create a function that contains a collection of information for the following. After you create the collection do the instructions below that.

Jonathan/John
Michael/Mike
William/Bill
Robert/Rob

a) Print the collection

b) Print William's nickname

Problem 4:

Create an array of 5 numbers. Using a loop, print the elements in the array reverse order. Do not use a function

Problem 5:

Create a function that will have a hard coded array then ask the user for a number. Use the userInput to state how many numbers in an array are higher, lower, or equal to it.