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
1. Digital videos look sharpest when they are displayed at a resolution that is larger than the frame size.
boyakko [2]

Answer:

(d) all of the above

Explanation:

This is because, not only is digital video a core technology for digital television, it also happens to be a core technology for video conferencing and video messaging. This could be seen in its application in messaging apps for private discussion of for holding official meetings between employees in virtual conference.

8 0
2 years ago
Password procedures, information encryption software, and firewalls are examples of measures taken to address:
Gnoma [55]
<span>Password procedures, information encryption software, and firewalls are examples of measures taken to address are all measures taken to safeguard information security and protect users data from being tampered or manipulated by invaders. 

In web, if we leave our information without encryption or if we leave our system without firewall, different types of security threats might arise: such as, information being hacked, manipulated or sent to wrong places. To avoid this information encryption is done. We might also need to firewall our system so that we can avoid unwanted access and invading of our privacy using malwares and other tools. </span>
5 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
diamong [38]
The answer is handouts.
A handout is a pamphlet with information on your presentation you can give to your audience
8 0
3 years ago
Question 6 options: This is a category or partitioned group of the small units of a programming language include its numeric lit
Wittaler [7]

Lexeme is a category or partitioned group of the small units of a programming language include its numeric literals, operators, and special words.

<h3>What is a lexeme in programming?</h3>

Lexemes are known to be those character strings that are put together from the character group of a program, and the token stands for what aspect of the program's grammar they are made of.

Hence, Lexeme is a category or partitioned group of the small units of a programming language include its numeric literals, operators, and special words.

Learn more about Lexeme from

brainly.com/question/14125370

#SPJ1

6 0
1 year ago
IDENTIFYING VERBS THAT AGREE IN NUMBER WITH THEIR SUBJECTS For each of the following sentences, write the correct form of the ve
Novay_Z [31]

Hey there!

  • The word "<u>verb</u>" simply means <em>'description of an action, assert, or event that is made into the main purpose of your predicate in your judgement' </em>
  • Now that we have the definition of the word verb we can answer your question
  • "<em>Has</em>" is past tense but it is THIRD person present
  • "<em>Have</em>" is when you own something
<h2>Answer: HAS ✅</h2>

BECAUSE "I SAW last night"

Note: usually people read the sentence to themselves until it makes easier sense to them or use context clues in the sentence to answer the particular question(s)

Good luck on your assignment and enjoy your day!

~LoveYourselfFirst:)

6 0
3 years ago
Read 2 more answers
Other questions:
  • What is the typical relationship between time and interest rate?
    12·1 answer
  • What is a common method for testing a spot weld?
    13·1 answer
  • How have search engines like Google, Bing, and Yahoo! revolutionized the ability to do research? They are more difficult to acce
    15·2 answers
  • Syntax errors ________. a. result from an attempt to perform an operation that cannot executeb. are errors such as misspelled ke
    14·1 answer
  • I love dog my is 16 weeks old how old is yours
    12·1 answer
  • Which of the following would an interactive media professional most likely need? A.a high school diploma
    15·1 answer
  • I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
    8·1 answer
  • PLEASE HURRY I WILL GIVE BRAILIEST TO WHO EVER ANSWERS AND IS CORRECT
    14·2 answers
  • The main part of your program has the following line of code.
    7·1 answer
  • What is the answer???​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!