answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
IrinaK
1 month ago
7

Q2 - Square Everything (0.25 points) Write a function called square_all that takes an input called collection that you assume to

be a list or tuple of numbers. This function should return a new list, which contains the square of each value in collection. To do so, inside the function, you will define a new list, use a loop to loop through the input list, use an operator to square the current value, and use the append method to add this to your output list. After the loop, return the output list.g
Computers and Technology
1 answer:
zubka84 [1K]1 month ago
4 0
Refer to the explanation Define the function square_all() that receives a list of integers. This function should return a new list containing the square values of all integers found within the provided list. def square_all(num_list): #Initiate an empty list to store results. sq_list = [] #Iterate through the length of the list. for index in range(0, len(num_list)): #Calculate the square of the current value and add it to the result list sq_list. sq_list.append(num_list[index] * num_list[index]) #Return the squared values of all integers in num_list. return sq_list #Declare and initialize a list of integers. intList = [2, 4] #Invoke the square_all() function and pass the above list as an argument. Show the returned list. print(square_all(intList))
You might be interested in
Technological improvements have allowed people to inhabit a wider variety of places more easily. Please select the best answer f
zubka84 [1067]

True. Technological advances have simplified and accelerated life, making it easier for people to live in a broader range of locations. Purchasing land or a home from a developer is one example of how this facilitates obtaining a desired place.

9 0
1 month ago
Read 2 more answers
CHALLENGE ACTIVITY 2.15.1: Reading and outputting strings. Write a program that reads a person's first and last names, separated
Harlamova29_29 [1022]

Response:

#include <iostream>

using namespace std;

int main()

{

   string Fname, Lname;

   cout << "Please enter your first name " <<"Please enter your last name" <<endl;

   cin>>Fname>>Lname;

   cout<<Lname<<", "<<Fname<<endl;

   return 0;

}

Clarification:

This code is coded in the C++ programming language. To begin with, two string variables are declared, namely Fname and Lname for the first and last names, respectively. The C++ cout function is utilized to ask users for their inputs, while the cin function takes in user inputs and stores them in the corresponding variables. The cout operator (<<) arranges the output in accordance with the specification given in the question

8 0
2 months ago
What ""old fashioned"" features of checking accounts is p2p replacing
zubka84 [1067]

Answer:

Bank or wire transactions and ATM cash withdrawals

Explanation:

With peer-to-peer options like PayPal and Venmo, there's significantly less need to handle cash, particularly when transferring between individuals.

If only one option is to be chosen, I would prefer "ATM Cash Withdrawals."

3 0
1 month ago
CodeHS Python Rainforest Exercise 5.4.7: Categories
Natasha_Volkova [1026]

Answer:

List1=[['Physics','Quantum Physics','Theory of Relativity'],['Geometry', 'Plane Geometry', 'Coordinate Geometry']]

i=0

k=0

for i in range(0,2):

   print("Category:" + List1[i][0])

   for k in range(1,3):

       print("\t" + List1[i][k])

   

Explanation:

The required program is outlined above. Despite having some limits, it sufficiently illustrates the necessary concepts.

6 0
2 months ago
Wendy is an attacker who recently gained access to a vulnerable web server running Microsoft Windows. What command can she use t
ivann1987 [1066]

Answer:

If she has successfully connected to the server and obtained access, Wendy should use the shortcut win+r (to run) or alternatively, she can utilize the "Type here to search" option.

Then she would enter "cmd" to access the command prompt.

Finally, she needs to employ the scp protocol for file transfers. Wendy may need to specify a destination for the files to be sent to.

7 0
2 months ago
Other questions:
  • Explain how abstraction is used in a GPS system
    12·2 answers
  • Write a method printShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, prin
    14·1 answer
  • Assign max_sum with the greater of num_a and num_b, PLUS the greater of num_y and num_z. Use just one statement. Hint: Call find
    5·1 answer
  • Which of the following best describes the protocols used on the Internet?
    12·1 answer
  • 6. A small design agency you are consulting for will be creating client websites and wants to purchase a web server so they can
    6·1 answer
  • This question refers to a standard deck of playing cards. If you are unfamiliar with playing cards, there is an explanation in P
    10·2 answers
  • For any element in keysList with a value greater than 50, print the corresponding value in itemsList, followed by a space. Ex: I
    8·1 answer
  • Write a class for a Cat that is a subclass of Pet. In addition to a name and owner, a cat will have a breed and will say "meow"
    9·1 answer
  • Which correctly lists the two elements that make up the empty space in the universe? ice and debris debris and dark matter dark
    7·2 answers
  • A business wants to centralize its administrative tasks. At the same time, it wants the existing systems to manage and sustain t
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!