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
sweet [91]
3 years ago
10

Write a function silence (typecode, length) that returns a new data array containing all zeros of the given type code and length

.
python programming
Computers and Technology
1 answer:
lions [1.4K]3 years ago
7 0

Answer:

Following are the code to this question:

import array as a#import package array  

def silence(typecode, length):#defining method silence that accepts two parameters  

   Val= a.array(typecode, [0]*length)#defining Val variable that stores zeros of the given type code and length

   return Val# use return keyword for return Val variable value

typecode = input('Enter typecode value: ')#use input method for input

length = int(input('Enter length value: '))#defining length variable that input integer value

print(*(silence(typecode, length)))#use print method to call silence method

Output:

Enter typecode value: b

Enter length value: 10

0 0 0 0 0 0 0 0 0 0

Explanation:

description of the code:

  • In the above-given Python code, Firstly we import a package that is the array, after that a method "silence" is defined that accepts two variables in its parameter that is "typecode and length".
  • Inside the method, the "Val" variable is declared, which is used to calculate and store all zeros of the typecode and length variable.
  • Outside the method, "typecode and length variable" is used for input the value from the user end-use the print method to call the function "silence" with an asterisk.
You might be interested in
To discover how many cells in a range contain values that meet a single criterion, use the ___ function
alexandr402 [8]

Answer:

COUNTIF

Explanation:

the Countif function counts the number of cells in range that meets a given criteria.

6 0
3 years ago
5. How should you use LinkedIn Answers as a professional?
harkovskaia [24]

The LinkedIn Answers is a component of LinkedIn that allows you to get fast and accurate solutions to your questions. It provides a forum through which you can demonstrate your expertise by offering info to your network. You should use LinkedIn answers to ask and answer questions. Essentially, you should use it to provide examples to your work product, decision making skills, and on an interactive basis.






5 0
3 years ago
Can someone help me so I don’t fail this class:(
charle [14.2K]

Answer:

Whatcha need help with?

Explanation:

4 0
3 years ago
Which type of network involves buildings in multiple cities connecting to each other?
NeX [460]

Answer:

Power lines

Explanation:

Because their everywhere

4 0
3 years ago
Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
kumpel [21]

Explanation:

hope this help here is the answer

3 0
3 years ago
Other questions:
  • You've decided to use a subnet mask of 255.255.192.0 with your 172.17.0.0 network to create four separate subnets. The network I
    13·1 answer
  • Whenever I go onto Google Chrome, the words are in Spanish! How can I make the words be back in English again? Please let me kno
    7·1 answer
  • An advertiser who sells coffee beans adds the keyword "Java'" to an ad group. After two weeks, she runs a placement performance
    11·1 answer
  • An algorithm written out in plain English statements is called __________.
    8·1 answer
  • Define get_date() function.
    6·1 answer
  • Assuming the Direct Hashing function and the Subtraction preprocessing algorithm is used to map keys into indices, give the inde
    15·1 answer
  • Indicate whether the statement is true or false. ____ 1. Autoglobal array elements are referred to with an index number. ____ 2.
    9·1 answer
  • KAPWING Video Editing Software allows you to use existing You Tube Videos in your design.
    8·1 answer
  • Write an algorithm to find the average of three numbers: 10, 20, 30
    7·1 answer
  • In a selection, the else clause executes ______________. a. always b. when the tested condition is false c. when the tested cond
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!