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
What translates binary data into images on a monitor?
g100num [7]
A video card is what allows a computer to translate the binary data into images.
8 0
3 years ago
There are three managerial skills listed that a good administrative medical assistant (MAA) should prosses
Yuliya22 [10]
Ask for detalls follow report
5 0
3 years ago
For each of the descriptions below, perform the following tasks:
ss7ja [257]

ANSWER:

1)i. The relationship is a degree of 2 ( i.e Binary). The cardinality of the relationship is One-to-Many.

ii. The model is from piano description to piano manufacturer.

PIANO:

Model name

Model number

Serial number

Manufacturing completion date

MANUFACTURER:

Ebony and Ivory

2)i. The relationship is a degree of 2 ( i.e Binary). The cardinality of the relationship is Many-to-Many.

ii. The model is from piano description to Technician.

PIANO:

Model name

Model number

Serial number

Manufacturing completion date

TECHNICIAN

Employee number

Specialty

3)i. The relationship is a degree of 2 (i.e Binary). The cardinality of the relationship is Many-to-One.

ii. The model is from Technician to Technician

TECHNICIAN:

Lower rank

TECHNICIAN:

Higher rank

5 0
3 years ago
Return a version of the given string, where for every star (*) in the string the star and the chars immediately to its left and
lana [24]

Answer:

Explanation:

The following code is written in Java and uses a for loop with a series of IF ELSE statements to check the next and previous characters in a string. Checking to make sure that there are no asterix. If so it adds that character to the String variable output. Which is returned to the user at the end of the method. Two test cases have been created and the output can be seen in the attached image below.

class Brainly {

   public static void main(String[] args) {

       System.out.println(starOut("sm*eilly"));

       System.out.println(starOut("ab**cd"));

   }

   public static String starOut(String str) {

       String output = "";

       for (int i = 0; i < str.length(); i++) {

           if ((i != 0) && (i != str.length()-1)) {

               if ((str.charAt(i-1) != '*') && (str.charAt(i+1) != '*') && (str.charAt(i) != '*')) {

                   output += str.charAt(i);

               }

           } else {

               if ((i == 0) && (str.charAt(i) != '*') && (str.charAt(i+1) != '*')) {

                   output += str.charAt(i);

               } else if ((i == str.length()-1) && (str.charAt(i) != '*') && (str.charAt(i-1) != '*')) {

                   output += str.charAt(i);

               }

           }

       }

       return output;

   }

}

4 0
3 years ago
Excerpt from "How Prepared Are Students for College Level Reading? Applying a Lexile-Based Approach."
Verizon [17]

Answer: Students graduating from high school are not prepared for college-level work.

Explanation:

From the excerpt, it was written that there is a high rates of enrollment in remedial college courses which shows that there are many students are graduating from high school who are unprepared for college-level work.

Therefore, based on this, the best summary of the paragraph is that the students graduating from high school are not prepared for college-level work.

Therefore, the correct option is C.

7 0
3 years ago
Other questions:
  • Dan needs to ensure that delegates as well as those looking at his shared calendar information are unable to see the details of
    7·1 answer
  • Analyze the following code. Select one: A. The code is wrong. You should replace if (even) with if (even == true). B. The code d
    13·1 answer
  • According to the video, who is the most common employer for Foresters?
    14·2 answers
  • When you create an internal hyperlink, you create the link that points to the bookmark using the anchor tag with which attribute
    15·1 answer
  • In a stream channel what is deposited first?
    7·1 answer
  • First person to answer gets free brainlist
    15·2 answers
  • Pleaseeeeeeee tellllllllllllllllllllll​
    8·1 answer
  • I need somebody to help me with this question I’ll give points!<br> Please help no funny business
    14·1 answer
  • Which type of malware prevents you from accessing files stored on your computer?
    10·2 answers
  • Does anyone know how to permanently delete photos on a dell computer? For my cousin.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!