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]
3 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]3 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
Tablets combine the features of which two types of devices?
VikaD [51]
A tablet<span> is a wireless, portable personal computer with a touchscreen interface. The </span>tablet<span> form factor is typically smaller than a notebook computer, but larger than a smartphone.
</span>
5 0
3 years ago
List four useful spreadsheet functions and explain what they do.
Helen [10]

Answer:

SUM, AVERAGE, MAX,MIN

Explanation:

Sum: The SUM function is categorized under Excel Math and Trigonometry functions. ... The function will sum up cells that are supplied as multiple arguments. It is the most popular and widely used function in Excel. SUM helps users perform a quick summation of specified cells in MS Excel.

Average: The AVERAGE function in Excel does exactly what you think it should. It computes the mathematical average of a set of numbers. In other words, it adds up a set of numbers and then divides the sum by how many numbers are being averaged.

Max: he MAX function will count numbers but ignore empty cells, text, the logical values TRUE and FALSE, and text values. In financial analysis, MAX can be useful in calculating the highest score, the fastest time, the highest expense or revenue amount, etc.

Min: will return the minimum value in a given list of arguments. From a given set of numeric values, it will return the smallest value. Unlike the MINA function, the MIN function ignores numbers, text, and logical values TRUE and FALSE and text values. In financial modeling.

8 0
3 years ago
here are pros and cons for doing temp work. Please select the best answer from the choices provided T F
Brut [27]

Answer:

Hello! the answer should be true, I hope i got here in time.  

Explanation:

6 0
3 years ago
Read 2 more answers
Which of these agents of education empowers the other..........
Tomtit [17]

Answer:

B. school

Explanation:

Because the school is where you learn and gain knowledge

4 0
2 years ago
Read 2 more answers
Server virtualization in windows server 2012 r2 is based on a module called the
alexgriva [62]
<span>Server virtualization in windows server 2012 r2 is based on a module called the</span> hypervisor.
3 0
3 years ago
Other questions:
  • The trademarked name of the accepted standard for configuring wireless networks is _______________
    12·1 answer
  • In the 2007/2010 version of Paint, which of the following tools are located in the View tab? (Select all that apply.)
    5·1 answer
  • Write an efficient C++ function that takes any integer value i and returns 2^i ,as a long value. Your function should not multip
    13·1 answer
  • A disgruntled employee can harm a company by launching a computer virus, changing or deleting files, or exposing system password
    14·1 answer
  • ____ contain instructions for the OS for hardware devices, such as the keyboard, mouse, and video card, and are stored in the sy
    15·1 answer
  • What is 450 g of flour a measure of?
    11·1 answer
  • You have heard that it is possible to improve your computer's performance by storing all related files for a particular program
    9·1 answer
  • Write a program that repeatedly takes integers from the user as long as he
    7·1 answer
  • 1.
    7·1 answer
  • Which of the following tasks are suitable for creating an algorithm? Choose all that apply
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!