Question

When using Python 3 lists {fill in the blank}. A. ! a negative lookup (such as...

When using Python 3 lists {fill in the blank}.

A. ! a negative lookup (such as `somelist[-3]`) refers to list values positioned relative to the end of the list

B. a copy of the list contents is made as the result of a statement such as `some_other_list = somelist`

C. ! we can refer to the list from the second element to the end using `somelist[1:]`

D. Python 3 ensures all values within the same list have the same type

E. None of the above.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:D

A. ! a negative lookup (such as `somelist[-3]`) refers to list values positioned relative to the end of the list - True

Explanation:

list1=[1,2,3]

print(list1[-1]) is acutally going to print 3 which is the last element of the list. using a negative look up we are accessing the list from rare

B. a copy of the list contents is made as the result of a statement such as `some_other_list = somelist` - True

copying contents of a list to another list in python is easy

one=[1,2,3]

two=one

is just going to copy the list

C. ! we can refer to the list from the second element to the end using `somelist[1:]`- True

That is the correct syntax in python

D. Python 3 ensures all values within the same list have the same type -False

list1=[1,'b',3.3,'samantha'] this list is valid in python

print(list1[1]) and this line is going to print b to the terminal

E. None of the above.

Add a comment
Know the answer?
Add Answer to:
When using Python 3 lists {fill in the blank}. A. ! a negative lookup (such as...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PYTHON: Using Lists and Arrays! 3. Design a program that generates a seven-digit lottery number. The...

    PYTHON: Using Lists and Arrays! 3. Design a program that generates a seven-digit lottery number. The program should generate seven random numbers, each in the range of 0 through 9, and assign each number to a list element. (Random numbers were discussed in Chapter 5.) Then write another loop that displays the contents of the list.

  • Consider the list myList: myList = ["a", "America", "1", [5,3,9], "3", ["Mercy"]] #1 1) The Python...

    Consider the list myList: myList = ["a", "America", "1", [5,3,9], "3", ["Mercy"]] #1 1) The Python statement __________________ returns a #2 2) The Python statement __________________ returns America #3 3) The Python statement __________________ returns Ame #4 The type of the third element is _______. #6 The Python statement __________________ returns the following: ['Mercy'] #7 The python statement temp = _______ converts the third element to integer and assigns the result to temp. #8 Consider the fourth element of myList...

  • PYTHON LANGUAGE Task 11 -Create a list with 5 items having 3 distinct data types -output...

    PYTHON LANGUAGE Task 11 -Create a list with 5 items having 3 distinct data types -output the second element of the list -output the last element of the list using -negative index -positive index -len method Task 12 -Create a list with 3 items -add an item to the end of the list -remove the first item of the list -determine if an item exists in the list -if it does, display its index -if it does not, give user...

  • C# code Arrays and Linked Lists: Write C++/Java/C#/Python code to declare an array of linked lists...

    C# code Arrays and Linked Lists: Write C++/Java/C#/Python code to declare an array of linked lists of any primitive type you want. (Array of size 2020) (This could be based on MSDN libraries or the lab) – you do not need to instantiate any of the linked lists to contain any actual values. Paste your code for that here (this should only be one line) Based on your code or the lab from 4 or your doubly linked list from...

  • 1) Which of the following is NOT true about a Python variable? a) A Python variable...

    1) Which of the following is NOT true about a Python variable? a) A Python variable must have a value b) A Python variable can be deleted c) The lifetime of a Python variable is the whole duration of a program execution.   d) A Python variable can have the value None.        2) Given the code segment:        What is the result of executing the code segment? a) Syntax error b) Runtime error c) No error      d) Logic error 3) What...

  • 1. In Python, 'mutable' objects such as lists are passed to functions 'by reference'. This means:...

    1. In Python, 'mutable' objects such as lists are passed to functions 'by reference'. This means: a.) Changes made to the object within the function persist after the function completes b.) The function receives a copy of the object c.) Python keeps a history of where then object was used d.) Statements in the function can refer to the object by nickname 2. Which of the following is NOT a requirement for a Python function: a.) The function must have...

  • I want this using while loop This using stringin python Use list or some thing in...

    I want this using while loop This using stringin python Use list or some thing in python Using list in python I want answer as soon as posdible E. Last Number time limit per test: 1 second memory limit per test: 256 megabytes input standard input output standard output You are given a sequence of positive integers aj, , 03, ... Print the last element of the sequence. Input The input consists of multiple lines. The i-th line contains a...

  • IN PYTHON Develop the program that will allow you to obtain an ordered list of whole...

    IN PYTHON Develop the program that will allow you to obtain an ordered list of whole numbers from least to greatest from two lists of whole numbers. The individual values ​​of the input lists are captured by the user one by one and then both lists will be joined and then sorted in ascending order (from lowest to highest value). Your program should allow the capture of the entire values ​​of the lists without making use of messages (legends) to...

  • In PYTHON! Exercise 3: Lists and Functions In this exercise we will explore the use of...

    In PYTHON! Exercise 3: Lists and Functions In this exercise we will explore the use of lists and functions with multiple inputs and multiple outputs. Your task is to implement the separate_and_sort function. This function takes two input parameters: 1. A list containing strings and integers in any order. 2. An optional integer parameter size which controls how many items in the list the function will process. If the length of the list is smaller than the value of size,...

  • using python The following shows the result of calling function read_from_file_sum_squares() for each of these two...

    using python The following shows the result of calling function read_from_file_sum_squares() for each of these two files: >>> from praco import read_from_file_sum_squares >>> read_from_file_sum_squares () Enter the filename: file1 9 >>> read_from_file_sum_squares () Enter the filename: file2 14 20 1 >>> You can use file = open(filename, "r") to open the file named by string filename to read, and the line list_lines = file.readlines() to store in list_lines the list of strings, where each string is a line of the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT