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
ludmilkaskok [199]
3 years ago
11

Create a function generateString(char, val) that returns a string with val number of char characters concatenated together. For

example generateString('a', 7) will return aaaaaaa.
Computers and Technology
2 answers:
Grace [21]3 years ago
8 0

Answer:

The solution code is written in Python.

  1. def generateString(char, val):
  2.    output = ""
  3.    for i in range(val):
  4.        output += char
  5.    
  6.    return output  
  7. print(generateString('a', 7))

Explanation:

Firstly, let's create a function <em>generateString()</em> that take two input arguments, <em>char</em> and<em> val.</em>

To generate a string with <em>val </em>number of <em>char</em>, we need a string variable, <em>output,</em> to hold the string value. Let's initialize the <em>output</em> with an empty string (Line 2)

Next, we can create a for loop that will repeat the loop for <em>val</em> number of time (using the <em>range() </em>method) and keep adding the same <em>char</em> to the <em>output</em> string (Line 5).

At last return the <em>output</em> string (Line 7).

WARRIOR [948]3 years ago
5 0

I have write a very simple code for you in python and i hope it will help you a lot.


def generateString(char, val):

   print(char * val)

Explanation:

This is how you can create your function in python and this function will give you the desired output.


How to Call a function:

generateString('a',12)

this is how you can call the function to get output.

I hope you get the idea.



You might be interested in
What piece of software tells the operating system how to use a specific hardware device?
professor190 [17]
A driver for that hardware specific task. Like Nvidia makes GPU's so they also make GPU drivers
8 0
3 years ago
You could be electrocuted if you try to use water to put out a
Tanzania [10]
The answer is A. class C fire.

A class C fire involves energized electrical equipment.
Examples are: appliances, car motors, etc.
3 0
2 years ago
Read 2 more answers
I need help plzzzzzzzz
Blababa [14]

Answer:

The output is second half of the month, refers to both

4 0
2 years ago
Read 2 more answers
In addition to MLA, what are some other widely used style guides? Check all that apply.
STALIN [3.7K]

Answer:

In addition to MLA, <u>American psychological association, Associated Press and Chicago manual of style</u> are widely using referencing techniques,

Explanation:

<u>American Psychological Association(APA)</u>

APA is the largest organization of scholars, they have their own referencing style guidelines that is used by these scholars.

<u>Associated Press</u>

It is also an american based agency that have their own referencing style for citation of research work named as Associated press.

<u>Chicago Manual of Style</u>

It is also an american referencing style used for reference.

8 0
2 years ago
Rward
Harlamova29_29 [7]

The toolset combination that has the potential to provide the complete end to end solution is Kore.ai, Smart Analytics, IKON, Dynatrace, and Remedy. Dynatrace is a monitoring platform.

The Kore.ai refers to a “no-code” platform used for the design, build, host and deployment of AI-rich assistants.

Dynatrace can be defined as a useful software intelligence platform used to accelerate digital transformation.

Remedy nowadays represents the Service Management Business Unit of BMC Software.

Learn more about toolset combination here:

brainly.com/question/14364696

7 0
2 years ago
Other questions:
  • This program will output a right triangle based on user specified height triangle_height and symbol triangle_char. (1) The given
    9·1 answer
  • What are the four primary factors described in the text that set the state for Web 2.0 or the social Web that we enjoy today??
    12·1 answer
  • Which of the following patterns of cell phone use can be observed in this chart
    12·1 answer
  • A network address is 131.247.160.0/19. The 19 implies that
    5·1 answer
  • According to the Computing Research Association, the number of undergraduate degrees awarded in computer science at doctoral-gra
    11·1 answer
  • A(n) ________ CPU has two processing paths, allowing it to process more than one instruction at a time.
    9·2 answers
  • A program that processes data submitted by the user. Allows a Web server to pass control to a software application, based on use
    11·1 answer
  • During a network infrastructure upgrade, you have replaced two 10 Mbps hubs with switches and upgraded from Category 3 UTP cable
    6·1 answer
  • Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and a
    6·1 answer
  • What are the functions of super computer?<br> ​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!