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
Rudiy27
4 years ago
6

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

Computers and Technology
1 answer:
NikAS [45]4 years ago
3 0

Answer:

Here is the function generateString() which has two parameters char for storing characters of a string and val is a number in order to return string with val number of char characters.        

def generateString(char, val):

 result = char * val

 return result      

If you want to see if the function works correct and generates right output you can check it by calling the generateString() function and passing values to it and printing the result using print() function as following:

print(generateString('a',7))

This will produce the following output:

aaaaaaa

   

Explanation:

The complete program is:

import sys

character= sys.argv[1]

count= int(sys.argv[2])

# Your code goes here

def generateString(char, val):

 result = char * val

 return result

print(character*count)

The logic of this function generateString(char, val) is explained below.

Lets say the value of char = a and val = 3 This means that generateString() should return 3 a's concatenated together. This concatenation is done by multiplication of the value of char i.e. 3 with the value of val i.e. 3.

So printing a 3 times displays aaa  

You might be interested in
What folder in windows is intended to be used for folders and files that all users of a computer share?
andrew11 [14]
The <span>Public folder is meant to be used by all users.</span>
4 0
4 years ago
Which one is better AMD Ryzen 5 Or Nvidia Gtx 2080 ti
Oliga [24]

Answer:

The NVIDIA GTX 2030 Ti

Explanation:

The AMD Ryzen 5 is good for a starting gaming PC, but if you are looking for a gaming PC that could run a lot more games, use the NVIDIA GTX 2080 Ti.

8 0
3 years ago
Which ssh option should you enter at the command prompt to set up an ssh tunnel for x server traffic?
skad [1K]
The proper command is ssh -x
7 0
4 years ago
Which of the following is the correct ordering of operating systems, oldest to newest?
cupoosta [38]

Answer:

Explanation:

The oldest operating system is Version 6 Unix 1975 and the next is 1BSD 1977, then we can find the Apple DOS 1978, in several years we have Mac OS (System 1.0) 1984, in 1985 was born one of the most popular OS in the world Windows 1.0, and Linux version 0.01-0.1 is the newest in 1991.

Nowadays we can find other system like android, windows 10 or Chrome OS.

4 0
3 years ago
Read 2 more answers
What problem is faced by multicore processors running older software written for single-brain chips? Multicore processors usuall
diamong [38]

Answer:

First option i.e., Multicore processors usually run older software by using only one core at a time.

Explanation:

Multicore processors performing earlier software composed against particular memory chips which would be Multicore processor typically perform earlier apps only by single core at the same period are facing the following issue.

It is the core that has connected double or even more processors for increasing its work, minimal energy usage and much more robust combined execution of multitasking

3 0
3 years ago
Other questions:
  • Tag groups can be nested up to ____ levels deep, with up to _______ tag subgroups under a single parent.
    14·1 answer
  • In the Scrum board, prioritizing the issue backlog is done in the ———- mode.
    7·1 answer
  • Which was the first wiki based website
    15·2 answers
  • For which of the following purposes can a database be used?
    5·1 answer
  • Hey so if an instagram account has an email attached to it but a person no longer has access to that email, how do they get back
    10·1 answer
  • The program below is used to calcualte the sum of 3 numbers. There is an error in this program. Which line contains the error? n
    11·1 answer
  • 20
    6·1 answer
  • In the GO programming language you can't declare a float, it must be a float32 or float64. Why do you think this is done if the
    10·1 answer
  • Stay at least _____ behind the vehicle ahead of you at all times.
    12·2 answers
  • What is tha length of Mac address ?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!