Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 11, Problem 4MC
Program Description Answer
Some of the “list” methods in Python are: “append ()”, “remove ()”, “index ()”, “pop ()”, “insert ()”, and so on.
Therefore, the correct option is “C”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
In python which of the following functions as used to add a value to the end of the list?
A. add
B. append
C. push
D. end
Which of the following functions is used to return a value add an index position in the list and remove that item from the list? In Python?
A. remove
B. pop
C. push
D. top
a-)Write a game of rock paper scissors, one of the choices will be from the user and theother from the computer (use random) Print results for each game.Play the games in a row until you exit the game. Explain each step as comment.Game rules:Rock crushes scissors, you win.Paper covers rock, you win.Scissors cut paper, you win.(İn Python)
b-)Write a program that sorts a list in ascending order. Don’t use sort method.Ask user number of list elements (at least 10 elements)Enter all elements from keyboard and printed.Sort your list.(İn python)
c-)Write a code for craps game. Craps is a dice game in which the players make wagerson the outcome of the roll, or a series of rolls, of a pair of dice.The rules of the dice game craps are as follows:You roll two dice. Each die has six faces, which contain one, two, three, four, five and six spots,respectively. After the dice have come to rest, the sum of the spots on the two upward faces iscalculated. If the sum is 7 or 11 on the first throw, you…
Chapter 11 Solutions
Python Programming: An Introduction to Computer Science, 3rd Ed.
Ch. 11 - Prob. 1TFCh. 11 - Prob. 2TFCh. 11 - Prob. 3TFCh. 11 - Prob. 4TFCh. 11 - Prob. 5TFCh. 11 - Prob. 6TFCh. 11 - Prob. 7TFCh. 11 - Prob. 8TFCh. 11 - Prob. 9TFCh. 11 - Prob. 1MC
Ch. 11 - Prob. 2MCCh. 11 - Prob. 3MCCh. 11 - Prob. 4MCCh. 11 - Prob. 5MCCh. 11 - Prob. 6MCCh. 11 - Prob. 7MCCh. 11 - Prob. 8MCCh. 11 - Prob. 9MCCh. 11 - Prob. 10MCCh. 11 - Prob. 1DCh. 11 - Prob. 2DCh. 11 - Prob. 1PECh. 11 - Prob. 2PECh. 11 - Prob. 3PECh. 11 - Prob. 5PECh. 11 - Prob. 6PECh. 11 - Prob. 7PECh. 11 - Prob. 8PECh. 11 - Prob. 9PECh. 11 - Prob. 10PECh. 11 - Prob. 11PECh. 11 - Prob. 12PECh. 11 - Prob. 15PECh. 11 - Prob. 16PECh. 11 - Prob. 18PECh. 11 - Prob. 19PE
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Pythongiven the following lists, create a function that returns the name of the person who is obese based on their BMI.patient = ['Anna', 'Marie', 'Taylor', 'Alison']info = [[45, 1.5], [38, 1.4], [33, 1.7], [40, 1.5]](the given from list info is weight in kg and height in meters)formula for BMI: kg/m^2arrow_forwardIn Python: create a list called sums, which contains the sum of each of the numeric columnsarrow_forward(python) 20. Is the statement true or false? To add an element to the end of a list, use the insert function.arrow_forward
- Assume the following statement appears in a program: names = [] Which of the following statements would you use to add the string ‘Wendy’ to the list at index 0? Why would you select this statement instead of the other? a. names[0] = 'Wendy' b. names.append('Wendy')arrow_forwardIN PYTHON: DO NOT USE ENUMERATE OR NUMPY Write the following function that returns the location of the largest element in a two-dimensional list: def locateLargest(a): The return value is a one-dimensional list that contains two elements. These two elements indicate the row and column indexes of the largest element in the two-dimensional list. Write a test program that prompts the user to enter a two dimensional list and displays the location of the largest element in the list. Sample Run: Enter the number of rows in the list: 3 Enter a row: 20.6 40 1 4 Enter a row: 5.5 3 42 4.5 Enter a row: 46 32 4.4 12.1 The loacation of the largest element is at (0,2)arrow_forwardIn Python: The index of the last element in the list is? The size of the list minus 1 1 The size of the list 99arrow_forward
- In python please All print output should include descriptions as shown in the example output below. List Script Create a list called list1 that has elements 2, 4.1, 'hello'. Copy list1 to list2 so that list2 is an alias of list1. Copy list1 to list3 so that list3 is a new list (true deep copy). Using ==, compare list1 to list2, list1 to list3, and list2 to list3. Using is, compare list1 to list2, list1 to list3, and list2 to list3. Print the ids of list 1, list2, and list3. Append a new element with value 8 to list1. After the first element of list2, insert an element 'goodbye'. Remove the first element from list3. Print each of the three lists. Do the results match what you expected? Add the following at the end of the script to show your results: '''Execution results:paste execution results here'''arrow_forwardWhat is the name of the item-returning Python list function? sorted() Itemidgetter() everything() Osum()arrow_forwardWhich line of code will generate an error to the code below? a. list.add("papasa");b. list.add("ako");c. list.add(99);d. String s=list.get(1);e. System.out.println("element is: "+s);arrow_forward
- Python: What is the output of the following code? list1 = list(range (1,10,2)) list2 = list1 list1[01 = 20 print (list1) print (list2)arrow_forward(python) 26. To delete the element 3 in a list, use the following command: a. del list[3] b. del list[4] c. list.remove(3) d. list.remove(4)arrow_forwardWrite a statement that will print the first letter of each element of the following list: list1 = [‘Galileo’,‘Oliver’,’Ostwald’,’Descartes’].arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning