1answer.
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
AleksAgata [21]
4 years ago
15

Write a function called check_nums that takes a list as its parameter, and contains a while loop that only stops once the elemen

t of the list is the number 7. What is returned is a list of all of the numbers up until it reaches 7.
Computers and Technology
1 answer:
MissTica4 years ago
4 0

Answer:

Following are the program in the Python Programming Language:

def check_nums(length): #define function

 my_lst=[]  #set list type variable

 n=0  #set integer type variable

 while(length[n] != 7): #set the while loop  

   my_lst.append(length[n])  #append liat in my_lst

   n+=1  #increament in n

   if(len(length)==n): #set if condition

     break  #break the loop

 return my_lst  #return the list

l=[4,6,2,55,16,7,81]  #set list variable and assign list init

print(check_nums(l)) #call and print the function

<u>Output</u>:

[4, 6, 2, 55, 16]

Explanation:

Here, we define a function "check_nums()" and pass an argument in its parentheses inside the function,

  • we set list data type variable "my_lst" and integer type variable "n"
  • we set while loop and pass the condition is the variable "length[n]" is not equal to the 7 then, the value of "length[n] " is appends to the variable "my_lst" and increment in the variable "n" by 1.
  • we set if condition and check when the length of the variable "length" is equal to the variable "n" then, break the loop and return the value of "my_lst".

Finally, set the list type variable "l" and assign the list of numeric value in it then, call and print the function "check_nums"

You might be interested in
Which type of data in es changes least frequently?
avanturin [10]
All these types of data are part of the enterprise systems. <span>Organizational data includes the organizational structure of the company and</span> rarely changes. Master data includes customers, materials, and vendors and this type of data changes infrequently. Transaction data is associated with the execution of tasks and activities. Transaction data changes most frequently.
Organizational data changes least frequently .
4 0
3 years ago
Identify the selector in the following CSS code:
SashulF [63]

Answer:

The right answer is: Option A. h3

Explanation:

The purpose of using selectors in CSS is to find the elements in the HTML page to which the formatting will be applied.

Different type of selectors are used in CSS.

In the given code, h3 is the selector.

All the <h3> elements on the page will be of orange color and will have font size 12.

Hence,

The right answer is: Option A. h3

6 0
3 years ago
LAST TIME ASKING FOR APPS THAT ARE FREE THAT I DONT NEED TO PAY THE APPS HAVE TO HELP ME STOP VIRUSES FROM MY PHONE PLZ HELP THE
pashok25 [27]

Answer:

i wish i could help u but i cant find a "free" one

Explanation:

4 0
3 years ago
Read 2 more answers
A computer is a multipurpose device that accepts input processes data and produces output all according to a series of stored
yulyashka [42]
According to a series of stored procedures 
8 0
3 years ago
Which network could NOT carry commercial traffic?
sattari [20]

ARPANET would not carry it

4 0
3 years ago
Other questions:
  • What is an (CR) Optical character recognition?
    13·2 answers
  • Technical colleges offer certification in audio engineering through programs that are normally from 2 to 6 months long. False Tr
    14·1 answer
  • Find the maximum value and minimum value in below mention code. Assign the maximum value to maxMiles, and the minimum value to m
    11·1 answer
  • A + B (AC (B +C’) D) = A + BD
    10·2 answers
  • In the ADT graph the methid addVertex has efficiency
    15·1 answer
  • What are some professionals that complete network administrator
    11·1 answer
  • In cell B13, create a formula without a function using absolute references that subtracts the values of cells B5 and
    13·1 answer
  • Advancements in technology have made the global marketplace more accessible. True O False​
    11·2 answers
  • Computer programming 5
    10·1 answer
  • HELP ME ILL GIVE BRAINLY Input 50 numbers and then output the average of the negative numbers only. Write in pseudocode!
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!