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
Discuss how and why video game hardware affects game design and where you think the next generation of platforms will change tho
katovenus [111]
Ever since video games were first released, graphics have been a huge selling point for popular games. On today's market, most new AAA titles (games with the largest available budget) are focused on improving graphics over previous AAA titles. But improvements in graphics requires a more difficult calculation for the computer hardware. When working with high resolution textures, the hardware need to be able to load in assets faster than ever and since there are physical limitations to how fast these assets can be loaded by the hardware, game designers have to limit their assets size. Without limitations most hardware wouldn't be able to handle the ever growing size of assets. So a game designer is limited by the power of the current hardware when designing assets. However since improvements are made every year on hardware, improvements in graphics quality and the like can also be made but will be limited to the hardware limitations of the future hardware. On a side note, virtual reality graphics were hard to render at a decent resolution a couple of years ago due to hardware limitations. But with the improvement in hardware came also the improvements in resolution and responsiveness of the virtual reality experience. Another aspect of video hardware is also the graphics drivers, compatibility, game engine and much more, but these are the basics of why hardware affects game design.
6 0
3 years ago
Write code which takes inputs and creates two Rectangle objects (using the edhesive.shapes.Rectangle class) and compares them us
iogann1982 [59]

Answer:

System.out.println("Enter length:");

Scanner scan = new Scanner(System.in);

Double x = scan.nextDouble();

System.out.println("Enter 2 lengths:");

Double a = scan.nextDouble();

Double b = scan.nextDouble();

Rectangle rect = new Rectangle(x);

Rectangle rect2 = new Rectangle (a,b);

if (rect2.equals(rect)){

 System.out.print("Congruent Rectangles");

}

else {

 System.out.print("Different Rectangles");

}

 }

}

Explanation:

6 0
3 years ago
Check
Ne4ueva [31]

Answer:

B,C,E :)

Explanation:

8 0
3 years ago
Since JavaScript is case sensitive, one of the variables below needs to be
marusya05 [52]

Answer:

var is Good = FALSE needs to be fixed

bottom answer is method.

Explanation:

var is Good = FALSE because you are assigning a boolean and in js booleans are all lower case.

Functions that are stored in object properties are called “methods”

5 0
3 years ago
Who Has any idea How to code?
kkurt [141]
A bit I guess. I can only do C# though
8 0
3 years ago
Read 2 more answers
Other questions:
  • What is a search engine and how is it different from a browser?
    6·1 answer
  • To view the contents of a file that was compressed with the bzip2 utility, you must used the ____________________ command.
    9·1 answer
  • The acronym ________ is used by programmers to refer to the fact that computers cannot tell difference between good and bad data
    8·2 answers
  • Which of the following is a bad password? Select one: a. The acronym for the title of your favorite song plus the year it came o
    11·1 answer
  • Your mother is sure that you were driving too fast because she knows
    10·2 answers
  • Convert 42DB5000 base 16 to base 10 floating point form assuming this is a signed floating point encoding (IEEE754) (32-Bit)
    10·1 answer
  • What type of micro sd card is needed for this type of MP3 player? I tried searching it up and a bunch came up. I don’t know whic
    7·1 answer
  • CorpServ is a small company with 14 client systems and a network printer. Because there are only a limited number of networked s
    13·1 answer
  • The table shows the price of apples in the local market. What is the cost of 12 pounds of apples? Apples (pounds) Price (dollars
    13·1 answer
  • Game Design!
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!