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
MA_775_DIABLO [31]
4 years ago
9

The PadRight function has two parameters: S (a string) and N (an int), and returns as its result the string S padded on the righ

t with blanks until the length of S contains no fewer than N characters. The PadLeft function is identical to PadRight except that it adds blanks to the left side of the string. For example, the string "Frog" is four characters long, so PadLeft("Frog",7) would return the
Computers and Technology
1 answer:
oee [108]4 years ago
6 0

Answer:

The following code is written in python programming language:

def PadRight(S,N):   #define user defined function

 if(len(S)<N):    # set if condition

   S=S.ljust(N)   #set the space to right

   return S       # return the result

 

def PadLeft(S,N):    #define user defined function

 if(len(S)<N):    # set if condition

   S=S.rjust(N)   # set the space to left

   return S       # return the result

'''calling the function'''

print(PadLeft("Frog",7))

print(PadRight("Frog",7))

Output:

      Frog

Frog

Explanation:

Here, we define a user defined function "PadRight()" and pass two arguments in its parameter "S", "N".

Then, set the if condition and pass condition "len(S)<N" then, if the condition is true then the code inside the if condition set the space to right then, return the output.

After that, we again define a user defined function "PadLeft()" and pass two arguments in its parameter "S", "N".

Then, set the if condition and pass condition "len(S)<N" then, if the condition is true then the code inside the if condition set the space to right then, return the output.

You might be interested in
What is ana absolute adress
AleksAgata [21]

Answer:

The term <u>absolute</u> distinguishes it from a relative address, which indicates a location specifying a distance from another location. <u>Absolute addresses</u> are also called real addresses and machine addresses.

Explanation:

Sorry, I'm not so good at explaining things.. I hope I kinda gave you an idea on what it is though.

8 0
4 years ago
Most of the revenue that magazine companies generate comes from?
aliya0001 [1]

Answer:

The major source of revenue for magazine company is "Advertising".

Explanation:

There are many source of income for magazine company such as subscription, circulations, advertisements.

From all above mentioned source of revenues, major source of revenues is advertising. Magazine companies publish different ads of different companies on title page as well as inside the magazine to generate the revenue.

7 0
4 years ago
Read 2 more answers
Assume variable age = 22, pet = "dog", and pet_name = "Gerald".
xeze [42]

Answer:

You are22years old.Gerladthedogis22

5 0
3 years ago
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
4 years ago
Read 2 more answers
The expressionvecCont.empty() empties the vector container of allelements.
Semenov [28]

Answer:

False

Explanation:

vector is like a dynamic array that has a special ability to resize automatically when it required.

vector has several functions:

like, insert() to insert the element in the vector.

delete() for delete the one element at a time.

empty() is also the function used in the vector. It is used for checking the vector is empty or not.

it gives the Boolean value (TRUE or FALSE), if the vector is empty it gives the output TRUE if the vector is not empty it gives the output FALSE.

It is not used for empty or deletes all elements of the vector.

Therefore, the answer is False.

4 0
3 years ago
Other questions:
  • Which headphone is better for music
    7·1 answer
  • How are the stop lamp bulbs connected in relation to each other? a. In parallel. b. In series. c. In series/parallel. d. None of
    13·1 answer
  • Is using abbreviations and symbols in social media a problem? Why or why not?
    11·1 answer
  • ¿Qué 3 objetos son productos tecnológicos?
    9·1 answer
  • Without protocols the information sent and received through the Internet would never reach its intended target and even if it di
    6·1 answer
  • Computer-aided manufacturing (CAM) offers which possible benefits?
    15·2 answers
  • An exact-match query is:
    13·1 answer
  • Number Array Class
    5·1 answer
  • BST
    13·1 answer
  • Walter has an associate's degree in computer science and aspires to become a web developer. Which certification will help enhanc
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!