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]
4 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]4 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]4 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 is the value of 25 x 103 = ________?
ira [324]

Answer:

2575

heres coorect

6 0
3 years ago
Read 2 more answers
​When converting plain text to hexadecimal for use with ProDiscover, you need to place ____________ between each character's hex
mina [271]

Answer:

Null(00) is the correct answer to the following blank.

Explanation:

Because when we changing the plain text into the hexadecimal then, we have to place null(00) to use with pro-discover in the middle of each and every hexadecimal value. We use null(00) because the null value contains 0(zero) or having no value.

So, that's why the following answer i.e., null(00) is true.

3 0
4 years ago
Jen's laptop that is wirelessly connected to the home network router and turned on; her husband's PC, which connects to the rout
SVETLANKA909090 [29]

Answer:

The network is a LAN.

Explanation:

Computer networks are interconnection and intercommunication of computer devices to share resources. There are several types of computer networks, they are, LAN or local area network, WAN or wide area network, PAN or personal area networks, etc.

A LAN is a network of computer devices ranging from a floor of a building to the building of more. WAN is a network of LANs while a PAN is just a short 10-meter network between two Bluetooth connected devices.

The network described in the question is a wireless LAN or WLAN which is still a local area network.

8 0
3 years ago
Your computer is taking longer than usual to open files and you noticed that your hard drive light stays on longer than usual wh
cestrela7 [59]

No don't do that. The best way to handle this is to back up all memory on your hard drive and get a bigger size hard drive. Preferably a 2 tb, If need more storage than that then buy a 500 GB ssd Samsung or other products and watch a video how to install one its easy. Its like a Lego. I built my gaming PC and i am 14 so i bet you can too.

4 0
3 years ago
When an organizatin needs a program to do a very specific job, it mayhire someone to write _____ software.​
Harman [31]
Code sofware your welcome
8 0
3 years ago
Other questions:
  • Based on the chart below, which pie flavors make up approximately one-half of the total? A pie chart shows the following pie fla
    7·2 answers
  • Consider a tcp connection between host b and server
    9·1 answer
  • A Network Management Station (NMS) is using SNMP to manage some Cisco routers and switches with SNMPv2c. Which of the following
    10·2 answers
  • Write a program that will read the weight of a package of breakfast cereal in ounces and output the weight in metric tons as wel
    15·1 answer
  • Characteristics of hybrid computer​
    11·1 answer
  • How to prepare and draw a corresponding flowchart to compute the sum and product of all prime numbers between 1 and 50
    7·1 answer
  • We cannot share software in computer network true or false​
    9·1 answer
  • What are the ten application areas of computer?​
    10·1 answer
  • ________ is a technique where the general characteristics are kept and the details are hidden.
    15·1 answer
  • You are investigating the use of website and URL content filtering to prevent users from visiting certain websites. Which benefi
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!