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
In programming, what is a string?
vovikov84 [41]

Answer:

B.

Explanation:

A. is not the correct answer because that is called a LAN cable (ethernet)

C. is not correct because it has nothing to do with text messages or printing

D. is called a Bus, and isn't the right answer either

3 0
3 years ago
Read 2 more answers
Chunking is a good strategy for completing large assignments because it makes the work
Bess [88]

Answer:

ExChunking is a good strategy for completing large assignments because it makes the work

less boring.

more thorough.

less difficult.

more manageable.planation:

Explanation: less difficult (C)

8 0
3 years ago
Read 2 more answers
IN MICROSOFT EXCEL YOU CAN UES FOMULA TO DIVIDE OR MULTIPLY WHAT IS THE CORRECT FORMULA TO CALCULATE 4*6
nexus9112 [7]

You actually have the correct answer. An excel formula starts with = so your answer would be =4*6

8 0
3 years ago
fill down feature on a formula and you need to keep a cell reference the same which one will allow you to keep the same cell ref
dedylja [7]
A dollar sign after both the letter and the number for each cell reference you want to keep the same will keep it the same when using the fill down/across function.
6 0
3 years ago
PLEASE HELP ME ASAP!!! Looking at the misty rain and fog (pictured above) Explain at least two defensive driving techniques you
JulsSmile [24]
1.Slow down 2. Break earlier
7 0
3 years ago
Other questions:
  • Which statements describe the advantages of using XML?
    12·2 answers
  • Which osi reference model layer includes all programs on a computer that interact with the network?
    13·1 answer
  • How many points are in an inch? <br> A 24<br> B 50<br> C 72<br> D 100
    5·1 answer
  • An Internet user has a need to send private data to another user. Which of the following provides the most security when transmi
    15·2 answers
  • Which of the following statements is TRUE of the information systems (IS) department? A. The operations group monitors user expe
    8·1 answer
  • A web application is an example of:
    7·1 answer
  • An IT suspects that an unauthorized device is connected to a wireless network. This is a result of pastry sharing on a device br
    13·1 answer
  • Evie clicks through her presentation slides and realizes they all have transition effects coming from the same location, from th
    13·1 answer
  • Write a java code to print Multiplication Table Till 20
    14·2 answers
  • I am in class 7 should I go with java or python.​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!