# Choose the line needed.In order to use deques, you need to bring the deque methods into active memory.You do this by entering this line at the top of your program.

3 weeks ago

## Solution 1

Guest #7252776
3 weeks ago

from collections import deque

## 📚 Related Questions

Question
What is the missing line?

>>> myDeque = deque('dog')
_____
>>> myDeque
deque(['d', 'o', 'g', 'cat'])

>>> myDeque.insert('cat')
>>> myDeque.insert('cat')

>>> myDeque.appendleft('cat')
>>> myDeque.appendleft('cat')

>>> myDeque.append('cat')
>>> myDeque.append('cat')

>>> myDeque.appendright('cat')
>>> myDeque.appendright('cat')
Solution 1

i think myDeque.append('cat')

Question
Put the steps in order to produce the output shown below. Assume the indenting will be correct in the program.

2 1
6 1
3 1
2 5
6 5
3 5
Solution 1

for numD in [1, 5]:

for numC in [2, 6, 3]:

print(numC, numD)

Question
Choose the best collection for each situation.

You have a set of data that will not be changed and you will not need to add new items.

You wrote a loop to ask the user for a set of 100 numbers. You will add a number to the collection on each pass through the loop, then pass the collection to a function for processing.

You have the unique inventory number and description of every item in a store. You will need to add items when they come in and delete items when they are sold.
Solution 1

first: tuple

second: list

third: dictionary

Explanation:

first: tuple

tuples are immutable, so you can't add or remove items from a tuple

second: list

lists are mutable, so you can add and remove items from a list

third: dictionary

dictionaries are mutable, so you can add and remove items from a dictionary

Question
What are the missing parts to produce the following output?

0
2
4​

num in range(3):
print (num * )
Solution 1

using while loop

num = 0

while num < 5:

print(num)

num += 2

or you can use for loop and range

for num in range(0, 5, 2):

print(num)

both will produce the output

0

2

4

Question
What are the missing parts to produce the following output?

0
1
2

num in range(

):
print (num )
Solution 1

for num in range(0, 3):

print(num)

or

for num in range(3):

print(num)

both will produce the output

0

1

2

Question
What is the result of successfully applying a Machine Learning (ML) algorithm to analyze data?
Solution 1

ML predicts patterns based on previous experiences

Explanation:

The thought process is that the more information available to the machine gives it the ability to create a model based on historical, labelled data, to predict the value of something unknown or of unknown quantity but still based on new data.

example of this is predictive text.

Question
The main part of your program has the following line of code.

Which function finds the difference of 30 and 5 to return 25.

def Subtract(numA, numB):
return numB - numA
def Subtract(numA, numB): return numB - numA

def subtract(numA, numB):
return numA - numB
def subtract(numA, numB): return numA - numB

def subtract(numA, numB):
return numB - numA
def subtract(numA, numB): return numB - numA

def Subtract(numA, numB):
return numA - numB
Solution 1

def subtract(numA, numB):

return numA - numB

Question
that subtracts the variable down payment from the variable total and assigns the resuits to the variable dues
Solution 1

dues = total - down_payment

Explanation:

Question
Made an accidental purchase and requested a refund from (Apple) and the next day it WAS REFUNDED BTW. But the coins and etc. are still on my account. What if I spend the coins. Will I be recharged¿ (NOW ITS CURRENTLY THE DAY AFTER I WAS REFUNDED AND THE MONEY HASENT BEEN PUT BACK INTO MY ACCOUNT OFFICIALY¡¿)
Solution 1

You will not be charged again. The refund will be processed in 3-5 business days. and the coins will be removed from your account.

Question
How do computer programs ask us for information?
Solution 1

Computer Programs

Explanation:

Computer Programs , in some program language Actualy best program languages is javascript(using in big firms) , C# C Sharp , Python , C++ C Plus Plus in some provincions and technology , program you can doo in best Compilator is Visual Studio "Community"  for free 2015 , 2019 , 2022 like I Remember this versions  in this Compiler you can doo programs in C# , F# , C++ , class/es , biblioteks and plicks dll. , Console Aplications , Graphic Aplications  all i Plicks .exe  or other biblioteks , class or types but you mast doo Decision for programing language and start learning for many time for many years... too BIG SPECIALISATIONS

2410639
568681
480985
357176
274132
272936
249918
216424
119193
99545
70262
65481
36431
25365
24518
20622
19413
18387
3100