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
Lorico [155]
3 years ago
12

#Write a function called "scramble" that accepts a string #as an argument and returns a new string. The new string #should start

with the last half of the original string #and end with the first half. # #If the length of the string is odd, split the string #at the floor of the length / 2 (in other words, the second #half is the longer half). # #For example: # scramble("abcd") -> "cdab" # screamble("abcde") -> "cdeab" # scramble("railroad")) -> "roadrail" # scramble("fireworks")) -> "worksfire"
Computers and Technology
1 answer:
mojhsa [17]3 years ago
8 0

Answer:

def scramble(s):

   if len(s) % 2 == 1:

       index = int(len(s)//2)

   else:

       index = int(len(s)/2)

   

   return s[index:] + s[:index]

Explanation:

Create a function called scramble that takes one parameter, s

Check the length of the s using len function. If the length is odd, set the index as the floor of the length/2. Otherwise, set the index as length/2. Use index value to slice the s as two halves

Return the second half of the s and the second half of the s using slice notation (s[index:] represents the characters from half of the s to the end, s[:index] represents the characters from begining to the half of the s)

You might be interested in
Which of these are forms of data? Check all that apply.
kicyunya [14]
Files, photos, text. Podcast is just on the internet all together so not really saved data while graphs is more of a saved file. So I’d just say files,photos and texts.
6 0
3 years ago
Read 2 more answers
You are critiquing a logo design that one of your coworkers proposed. Your sense is that the individual elements of the design a
oksano4ka [1.4K]

Answer:

Unity.

Explanation:

Graphic design can be defined as an art which typically involves the combination of texts, images and colors to communicate an idea.

In graphic design, unity refers to the harmonious relationship between the various elements in a graphical piece of art, thus, making it appear as a single beautiful piece. Therefore, unity ensure a piece of work does not appear to the viewer as separate pieces but rather presents it as a single piece.

In this scenario, you are critiquing a logo design that one of your coworkers proposed. Your sense is that the individual elements of the design are fine, but when they are combined, they just don’t work well together. Thus, the main problem with this logo is unity.

8 0
3 years ago
What connector has 4 pins, is used for older IDE drives and some SATA drives, and can provide +5 V and +12 V power outputs?
Dominik [7]

Answer:

The correct answer to the following question will be "Molex connector".

Explanation:

The Molex connector can be used for power connections on some kind of device for just a disk drive as well as many other electronic devices including CD-ROMs, display chips, etc.

  • Inside a PC shell, the Molex connectors carry DC power to a device.
  • Most providers offer accessible connections, not only the Molex as well as AMP connectors.

So, it's the right answer.

3 0
3 years ago
List the two page orientations in Microsoft word​
stich3 [128]

Answer:

Portrait and landscape

Explanation:

please rate brainiest for my progression

4 0
3 years ago
What are 2 ways to access the vendor credit screen in quickbooks online?
kiruha [24]

Answer:

First by

Clicking

New Button (+) THEN click Vendor THEN click Credit

Secondly

Click Expenses Center then click New Transaction then finally click Vendor Credit

4 0
2 years ago
Other questions:
  • Julio is the department head for his company's customer service department. His staff has complained that they spend countless h
    13·2 answers
  • How can I sent a message?
    13·1 answer
  • A disadvantage of using an arithmetic mean to summarize a set of data is that __________.
    13·1 answer
  • In the early part of labor, contractions come every
    6·1 answer
  • Write an if statement that assigns 100 to x when y is equal to 0.
    7·1 answer
  • This is pixlr
    6·1 answer
  • From Blown to Bits why is it important to know what children are doing on the Web Tonight?
    7·1 answer
  • A _________ is a component commonly used in an analog pressure gauge. Use letter keys to select choices A microprocessor B press
    8·1 answer
  • Describe how data is transmitted using half-duplex serial data transmission.
    9·1 answer
  • In Super Mario Bros., you become Mario and your friend is Mario’s younger brother Luigi. Your job is to race through Mushroom Ki
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!