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
Veseljchak [2.6K]
3 years ago
10

def list_length(shrinking_list): ''' A recursive way to count the number of items in a list. ''' if shrinking_list

Computers and Technology
1 answer:
AnnZ [28]3 years ago
8 0

Answer:

Written in Python:

def list_length(shrinking_list):

    if not shrinking_list:

         return 0

    else:

         return list_length(shrinking_list[1:]) + len(shrinking_list[0])

Explanation:

This defines the list

def list_length(shrinking_list):

This checks if list is empty, if yes it returns 0

<em>     if not shrinking_list:</em>

<em>          return 0</em>

If list is not empty,

    else:

This calculates the length of the list, recursively

         return list_length(shrinking_list[1:]) + len(shrinking_list[0])

To call the function from the main, use:

<em>print(list_length(listname))</em>

You might be interested in
IT ethics are rules, policies, or principles that guide the behavior of IT professionals.
Vadim26 [7]

Answer: true

Explanation: true

6 0
3 years ago
Hi! This is python coding. Please don't take advantage, actually, answer!
Greeley [361]

Answer:

Try and do number = 7

If that does not work then I dont know what to tell you.

Explanation:

8 0
3 years ago
To move an icon, you right-click it and select “Pin to start menu.” True False
tester [92]

"To move an icon, you right-click it and select “Pin to start menu.” True False"

False

4 0
3 years ago
Read 2 more answers
VLSI is the process of creating an integrated circuit (IC) by combing thousands of transistors into a single chip. There are two
Tanya [424]

Answer:

ASIC

Explanation:

Undoubtedly, it is the ASIC and not FPGA. The field programmable Gate Array is meant for general purposes, and ASIC is meant for Specific purposes. And here the application-specific condition holds. We need it for medium production of an image transformation, and this is like Bitcoin which is application-specific. And thus, the correct type of IC which we need in this case is the FPGA, And hence, FPGA is the correct option here.

3 0
4 years ago
What is output?
postnew [5]

Answer:The French and Dutch settlements differed from the Spanish colonies in that they were created mainly to trade and develop industries, while the Spanish were primarily concerned with gold and silver excavation, and then later with sugar exportation.

Explanation:The French and Dutch settlements differed from the Spanish colonies in that they were created mainly to trade and develop industries, while the Spanish were primarily concerned with gold and silver excavation, and then later with sugar exportation.

8 0
3 years ago
Other questions:
  • a supermarket having a sale on canned foods' the sale includes 12 cans of soup for 10.65 what is the unit price per can of soup
    6·2 answers
  • The numbers on the bottom of a typical check represent all of the following EXCEPT?
    12·2 answers
  • What is Least effective at preventing a computer virus
    10·1 answer
  • An example of creative curating is when a:
    9·1 answer
  • Anyone 13 i a boy 13 pan
    12·2 answers
  • New product ideas must fit into a company's mission statement and?
    12·1 answer
  • We have studied machine cycle in class. Suppose that each of the four modules of machine cycle is taking 2 seconds. If there are
    5·1 answer
  • Which statement best defines the Control Pannel?
    12·1 answer
  • Describe accessibility in Windows 7 ​
    13·1 answer
  • What two items must be passed in a tuple to the socket module's connect method in order to connect a socket? (choose two.)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!