Python List Programming Problems - Computer Science 1 1. Create a list of your 5 of your favorite songs and print them out forward and backward. Do not use a loop. 2. Using the same list in problem 1,...

Can you do this?


Python List Programming Problems - Computer Science 1 1. Create a list of your 5 of your favorite songs and print them out forward and backward. Do not use a loop. 2. Using the same list in problem 1, print the list forward using a for each loop and a while loop. 3. Using the same list as in problem 1, add another song to the middle of your list using the insert function and delete your least favorite song from the list using the delete function. 4. Using the same list in problem 1, print the list forward, using a for each loop, and backwards using a while loop. 5. Using the same list in problem 1, print the first and last half of the list. 6. Create a pre defined list with the values of [11,22,33,44,55,66,77] Print out all of the even elements. So, the numbers 22, 44 and 66 should print because they are the even elements of the list. You’ll have to use a while loop. 7. Create that adds numbers using int(input(“Enter number”)) until the user types in a negative number. Compare the lengths of this list with the list in problem 6 and determine which one is bigger. Hint : while True: #set up a variable that is equal to a inputted number # if the inputted number is negative break out of the loop using break #add the inputted number to the list. 8. Using the same list in problem 6, print which numbers are even and which are odd. HINT: Use % in if statement 9. Create a tuple with the following numbers (5,9,4,7,9,2,9,9,6). a. Sum all the numbers in the list and print the result b. Print out the average of the list. You must use len(list variable) in the calculation. 10. Using the same list in number 9, a. print out how many 9s are in the list b. print how many numbers are not 9s in the list. HINT: You will have to use != in your if statement 11. Using the same list in number 9, count how many even and odd numbers are in the list.
Dec 17, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here