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
Which is the common name for a program that has no useful purpose, but attempts to spread itself to other systems and often dama
Maksim231197 [3]
Its know as a virus (a program created to spread and maliciously harm computers)
7 0
3 years ago
In a car crash, wearing a seat belt __________________.
Bad White [126]

In a car crash, wearing a seat belt

A. Keeps you from being thrown from the car

B. can reduce injuries

The answer is : C. all of the above

<h3>Further explanation </h3>

In Newton's law, it is stated that if the resultant force acts on an object of magnitude is zero, it can be formulated:

<h3>∑F = 0 </h3>

This value is for stationary objects or objects that move in a straight line

So if the resultant force on an object is zero, the object that was initially stationary will continue to remain stationary, and the object that was initially moving will continue to move at a constant speed

The size of inertia is proportional to mass, the greater the mass of the object, the greater the inertia of the object.

In objects with mass that move translatively, the object will maintain its linear velocity

When we are in a vehicle that moves forward, then we will still maintain a state of forwarding motion. If our vehicle stops suddenly, then we keep moving forward so we will be pushed forward. From this point, the use of a safety belt serves to hold back our movements so that there are no fatal injuries or collisions.

<h3>Learn more </h3>

Newton's law of inertia

brainly.com/question/1412777

example of Newton's First Law of inertia

brainly.com/question/1090504

law of motion

brainly.com/question/75210

Keywords: inertia, Newton's First Law, collisions, injuries, car accident, crash

7 0
3 years ago
Read 2 more answers
The features used be of Computer that tell, it every field.​
Ierofanga [76]

Answer:

Versatility

Explanation:

The capacity of computer of performing more than one task at the same time is called versatility of computer. Versatility means the capacity to perform different types of work completely

6 0
2 years ago
Given num_rows and num_cols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
soldi70 [24.7K]

Answer:

The program written in Python is as follows

Explanation:

4 0
3 years ago
How is the go button on m computer?
bearhunter [10]

<span>Go appears in the menu bar when Finder has focus, not in the Finder window.</span>
7 0
3 years ago
Other questions:
  • What are the main types of computer software?
    5·2 answers
  • Smoking is a REALLY good example of a choice that can have negative effects on the smoker's health, AND the well-being of others
    9·1 answer
  • Displays are geared for a specific resolution. what is this resolution called?
    15·1 answer
  • When a Python program is reading a file, the data is input as plain ASCII characters in a string. What is the following code doi
    15·1 answer
  • What method is used to manage contention-based access on a wireless network?
    7·1 answer
  • List the five parts of a system.describe them.
    13·1 answer
  • Choose the best type of loop for each situation.
    6·1 answer
  • Retail products are identified by their Universal Product Codes (UPCs). The most commonform of a UPC has 12 decimal digits: The
    8·1 answer
  • Hewo want to talk! #bored<br>Will randomly mark brainlest
    12·1 answer
  • (Synchronized threads) Write a program that launches 1000 threads. Each thread adds a random integer (ranging from 1 to 3, inclu
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!