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
A ___________ is the smallest unit in a written language.
Delvig [45]
A. string? maybee its a string of units


8 0
3 years ago
Read 2 more answers
The largest country in South America
ioda

Answer:

it's argentinian

Explanation:

7 0
2 years ago
13./ Write a java program to input an integer N and compute its factorial. Print the number and the factorial.
antoniya [11.8K]

Answer:

Código Java de forma recursiva que nos ayuda a calcular el factorial de ... El factorial de un número es la multiplicación de los número que van del ... Para expresar el factorial se suele utilizar la notación n! ... mayo 5, 2010 - 4:13 am ... un programa q de un numero dado en arabigo o romano lo imprima ya

Explanation:

Espero te sirva!!

3 0
2 years ago
Please help! I need to submit this quick!
taurus [48]

Answer:

B, C, A

Explanation:

i think those are right

3 0
3 years ago
Read 2 more answers
How could TWC continue to leverage mobile apps to further monetize its significant investment in its weather data? What addition
Ann [662]

<u>Explanation</u>:

To effectively Monetise mobile apps the latest trend usually involves focusing on user downloads and active user subscriptions.

Since TWC is a weather data analyst company, providing premium services via it's app not available on TV can increase user signups.

Their app could offer this use cases;

  • A platform were users share live weather data of their location that are factual.
  • Provide paid weather educational courses
8 0
2 years ago
Other questions:
  • You are given a network of 10.50.24.0/21, which contains 2,048 addresses. what subnet mask should you use to divide this into fo
    7·1 answer
  • WILL GIVE BRAINLIEST! A rent payment is an example of which type of expense?
    14·2 answers
  • Which reading strategy refers to reading only the key words and phrases?
    13·2 answers
  • You are manually configuring a tcp/ip host. another administrator gives you the router's ip address. what is the tcp/ip term for
    6·2 answers
  • What is not true of credit scores?
    11·1 answer
  • Why do bats sleep upside down
    7·1 answer
  • PLEASE HELP ASAP!! Timed test!!
    12·1 answer
  • Could anyone help me with this assignment please?
    6·1 answer
  • Explain why a holiday on a cruise liner will be an ideal holiday​
    12·1 answer
  • 1. Why does a computer have different types of ports?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!