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.

3 weeks ago

Solution 1

Guest Guest #7252760
3 weeks ago

Answer:

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

ūüďö Related Questions

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

0
2
4‚Äč


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

Answer:

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

Answer:

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

Answer:

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.

answer = difference(30,5)
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

Answer:

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

Answer:

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

Answer:

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

Answer:

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

Question
Enter an IFS statement to provide the certification grade based upon score (use the<=in your formula) include the IFERROR message as a error catch
Solution 1

Answer:

=IFERROR(IF(score<=100,"A",IF(score<=90,"B",IF(score<=80,"C",IF(score<=70,"D",IF(score<=60,"F","Invalid"))))),"Invalid")

Question
7.2.5 Height in Meters codehs
Solution 1

Answer:

INCHES_TO_CM = 2.54

CM_TO_METERS = 0.01

FEET_TO_INCHES = 12

def convert_height_to_meter(feet, inches):

   inches_total = (feet * FEET_TO_INCHES) + inches

   cm_total = inches_total * INCHES_TO_CM

   meters = cm_total * CM_TO_METERS

   print(str(feet)+" feet, "+str(inches)+" inches is "+str(meters)+" meters")

   

convert_height_to_meter(6, 4)

convert_height_to_meter(5, 8)

convert_height_to_meter(5, 2)

Question
Write this program in JAVASCRIPTT not phyton. Write a program that prompts the user for a meal: breakfast, lunch or dinner. Then using if Statements and else statements print the user a message recommending a meal. For example if the meal was breakfast, you could say something like, "How about some avacado on toast?" Below is a picture reference of the JavaScript language I use.
Solution 1

Answer:

is it like this?

let meal = prompt("What meal would you like to eat?")

if (meal == "breakfast") {

   console.log("How about some avocado on toast?")

} else if (meal == "lunch") {

   console.log("How about a salad?")

} else if (meal == "dinner") {

   console.log("How about some pasta?")

} else {

   console.log("How about a snack?")

}

Solution 2

The JavaScript program that prompts the user for a meal choice and recommends a meal based on their input:

```javascript

// Prompt the user for a meal choice

var meal = prompt("Enter a meal choice: breakfast, lunch, or dinner");

// Recommend a meal based on the user's input

if (meal === "breakfast") {

 console.log("How about some avocado on toast?");

} else if (meal === "lunch") {

 console.log("How about a chicken salad?");

} else if (meal === "dinner") {

 console.log("How about grilled salmon with roasted vegetables?");

} else {

 console.log("Invalid meal choice. Please enter breakfast, lunch, or dinner.");

}

```

In this program, the `prompt` function is used to display a dialog box asking the user for their meal choice.

The user's input is then stored in the `meal` variable. Using a series of `if` and `else if` statements, the program checks the value of `meal` and recommends a corresponding meal based on the user's choice.

Know more about JavaScript:

https://brainly.com/question/16698901

#SPJ6