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
Which presenter would most likely benefit from a custom slide show?
Gelneren [198K]
I would say a salesman or woman would most benefit from a custom slide show that shows a product, explains what it is, where it comes from, how it is made and especially how it can be used to benefit an organization as these things or qualities should be fairly cut and dried and well worked out unlike say a technique that depends on the circumstances like installing a piezometer (an instrument to read water pressure) in a drill hole in which case a particular slide show rather than a custom one would have to be used.
7 0
3 years ago
When mapping a drive, you can type in the path to the shared folder on the host computer. what is the syntax for the path?
fomenos
For SMB:  \\server\path\to\share
For CIFS: //server/path/to/share
3 0
4 years ago
Please define processor​
fredd [130]
Processor means to break down something.
6 0
3 years ago
The repair order is a legal document because?
svp [43]
D. It’s signed by the customer
4 0
3 years ago
Read 2 more answers
To create an instance of Big Decimal for 454.45, use ________.
agasfer [191]

Answer:

C.

Explanation:

Based on the Java documentation; when creating an instance of BigDecimal, we can pass a string as a constructor.

System.out.println(new BigDecimal("454.45"));

8 0
4 years ago
Other questions:
  • Assume you're using a three button mouse. to access shortcut menus you would
    10·1 answer
  • James wishes to access a certain software service via different computing systems over the Internet. What technology provides so
    13·2 answers
  • Examples of apps include pop-up windows, validation of webform inpts and images that change when a cursor passes over them
    12·1 answer
  • IOS 0R ANDR0ID ???
    13·1 answer
  • Once a graph has been created, you would need to start over to make any changes to it. true false
    15·1 answer
  • What is the multiple source test
    15·1 answer
  • The measure means to determine the exact size, amount, or distance of something
    11·1 answer
  • ____ is Windows XP system service dispatch stubs to executables functions and internal support functions.
    13·1 answer
  • These statements describe guidelines for the use of tables in presentations.
    9·2 answers
  • Write a recursive decent algorithm for a java while statement, a Javas if statement , an logical/mathematical expression based o
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!