subject

4-10. slices: using one of the programs you wrote in this chapter, add several lines to the end of the program that do the following: • print the message, the first three items in the list are: . then use a slice to print the first three items from that program’s list. • print the message, three items from the middle of the list are: . use a slice to print three items from the middle of the list. • print the message, the last three items in the list are: . use a slice to print the last three items in the list. 4-11. my pizzas, your pizzas: start with your program from exercise 4-1 (page 60). make a copy of the list of pizzas, and call it friend_pizzas. then, do the following: • add a new pizza to the original list. • add a different pizza to the list friend_pizzas. • prove that you have two separate lists. print the message, my favorite pizzas are: , and then use a for loop to print the first list. print the message, my friend’s favorite pizzas are: , and then use a for loop to print the second list. make sure each new pizza is stored in the appropriate list. 4-12. more loops: all versions of foods. py in this section have avoided using for loops when printing to save space. choose a version of foods. py, and write two for loops to print each list of foods.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:20
Write a program that reads a file consisting of students’ test scores in the range 0–200. it should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. output the score ranges and the number of students. (run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189.)
Answers: 3
question
Computers and Technology, 22.06.2019 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
question
Computers and Technology, 23.06.2019 01:50
Create a class named majors that includes an enumeration for the six majors offered by a college as follows: acc, chem, cis, eng, his, phys. display the enumeration values for the user, then prompt the user to enter a major. display the college division in which the major falls. acc and cis are in the business division, chem and phys are in the science division, and eng and his are in the humanities division. save the file as majors.java.
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
1. ask the user how many questions are in the quiz. 2. ask the user to enter the key (that is, the correct answers). there should be one answer for each question in the quiz, and each answer should be an integer. e.g., 34 7 13 100 81 3 9 10 321 12 might be the key for a 10-question quiz. you will need to store the key in an array. 3. ask the user to enter the answers for the quiz to be graded. there needs to be one answer for each question. note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered. 4. when the user has entered all of the answers to be graded, print the number correct and the percent correct. 5. add a loop so that the user can grade any number of quizzes with a single key. after the results have been printed for each quiz, ask "grade another quiz? (y/n)." note: you only have one array (the key). you are not creating a new key for each set of quiz answers.
Answers: 3
You know the right answer?
4-10. slices: using one of the programs you wrote in this chapter, add several lines to the end of...
Questions
question
English, 13.01.2020 17:31
Questions on the website: 13722363