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
Yakvenalex [24]
3 years ago
6

Write a function called getChar that has no function inputs, but takes in two character inputs from the user (in1 and in2) and o

utputs them to the function that calls them (The function must use input validation to make sure it is a character - Hint: use the length() function). Write another function called chars2string that takes in two character function inputs and combines them into one string that repeats each character 5 times and returns the joined string (as function output). Call both functions in a main function.

Computers and Technology
1 answer:
bearhunter [10]3 years ago
3 0

Answer:

def getChar():

   while True:

       in1 = input('Enter first char: ')

       try:

           if len(in1) != 1:

               raise

           else:

               in2 = input('Enter second char: ')

               if len(in2) != 1:

                   raise

               else:

                   break

       except:

           print('Enter just one character')

   return in1, in2

def chars2string(in1,in2):

   print(in1*5 + in2*5)

def main():

   ls = getChar()

   in1 = ls[0]

   in2 = ls[1]

   chars2string(in1, in2)

if __name__ == '__main__':

   main()

Explanation:

The programming language used is python 3.

The script first defines a function getChar and makes use of a while loop in combination with try and except blocks and IF statements, the code ensures that both inputs that are entered by the user after the prompt are 1 in length. i.e. Just one character. This function returns the two characters that were entered.

The second function that is defined is chars2string this function takes two arguments, It repeats each argument five times and returns a joined string.

Finally, the main function is defined and it calls the getChar function  first, the values that are returned by this function is assigned to two variables, that is then passed on to the chars2string function. The main function is called and the Joined string is printed to the screen.

You might be interested in
CHKDSK is a system utility that is commonly found in Windows. What is CHKDSK? Use the Internet to research and write about CHKDS
Alex_Xolod [135]

chkdsk is a utility that you use to check for bad sectors on a hard drive , as far as how to run it you open the start menu go to your run bar and type chkdsk then follow the instruction on the screen .

6 0
3 years ago
Read 2 more answers
A web-based application encounters all of the connectivity and compatibility problems that typically arise when different hardwa
andrezito [222]

Answer:

False

Explanation:

A web-based application encounters connectivity and compatibility relate to data server. It does not belong to any hardware environments.

A web based application is accessed over network.They run inside a web browser. Small of program is download to user's desktop, but this processing is done over internet.

6 0
3 years ago
Defination of health in multimedia.​
Vinvika [58]

Answer:

Explanation:Nowadays multimedia is characterized by a very complex nature due to the combination of different type of media, data sources, formats and resolutions, etc. Moreover, the performance is an important factor because of the sheer scale of the data to process. Therefore, the area of high-performance and scalable multimedia system gets more important. One of most important, complex and rapidly growing part of multimedia processing is the medical field. In most of the hospitals the potential of the large amount of collected multimedia data is ignored. This is very often because of the difficulties that processing such amount of data implies and lacking of efficient and simple-to-use analysis system. On the other hand, medical experts get more used to interact with multimedia content because of their daily live interaction and they want to use it also in their work. Most of the time this is a problem and the most common multimedia problems lay unsolved in this area. In this talk this problem is put into the spotlight and a multimedia system is presented that tackles automatic analysis of the gastrointestinal tract as a part of this problem. The focus lies on the presentation and evaluation of multimedia systems capabilities in the medical field. Therefore a novel system, that utilizes the benefits of heterogeneous architectures and can be used to automatically analyse high definition colonoscopies and large amount of capsular endoscopy devices are presented as a use case. Furhter it will be shown, that the improvement of multimedia systems performance via GPU-based processing which can help to reach real-time, live multimedia stream processing and low resource consumption which is important for the medical field and can help to save lives.

8 0
3 years ago
When a cardholder successfully contests a charge, the acquiring bank must retrieve the money it placed in the merchant account i
lions [1.4K]

Answer:

Charge back.

Explanation:

A chargeback is a charge that is returned to a payment card after a customer successfully disputes an item on their account transactions report. Simply put, it is the reversal of a credit card payment that comes directly from the bank.

Most commonly the payer is a consumer.

A chargeback may occur on bank accounts or credit cards. They can be granted to a cardholder for a variety of reasons. A chargeback can be considered a refund since it returns specified funds taken from an account through a prior purchase. Chargebacks are focused on charges that have been fully processed and settled. Chargebacks can often take several days for full settlement as they must be reversed through an electronic process involving multiple entities.

The chargeback is ordered by the bank that issued the consumer's payment card.

6 0
2 years ago
Today when Dylan turned on his computer, he noticed that the monitor was very dim. He could still see the desktop icon and text.
Amiraneli [1.4K]

Answer:

Monitor backlighting

Explanation:

Dylan haven done some troubleshooting on his computer to find out what the problem was but couldn't restore its brightness.

It then means that the Monitor backlighting caused the screen to be very dim.

The Monitor backlighting is bad or faulty.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Ruby is creating a presentation. She wants each slide displayed at intervals of five seconds. Which feature in the presentation
    6·2 answers
  • The equation x + y2-4x+2y=b describes a circle.
    8·1 answer
  • What feature of a word processing program helps you to easily check and correct spelling mistakes?
    9·1 answer
  • What property do we use to distinguish a specific element from a form? value name click this
    12·1 answer
  • Write the definition of a method named countPos that receives a reference to a Scanner object associated with a stream of input
    13·1 answer
  • What are the benefits of writing functions that use parameters and return List 2 please and explain what is return
    12·1 answer
  • What is the difference between a programming language and natural (every-day) language?
    12·1 answer
  • Assume you are using the text's array-based queue and have just instantiated a queue of capacity 10. You enqueue 5 elements and
    13·1 answer
  • I can’t wait Till Miya’s anniversary skin To be released on september 21st
    6·1 answer
  • The other term for template document is _______.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!