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
max2010maxim [7]
3 years ago
15

write a function copy(s, n) that takes as inputs a string s and an integer n, and that uses recursion to create and return a str

ing in which n copies of s have been concatenated together. python
Computers and Technology
1 answer:
Yuri [45]3 years ago
8 0

Answer:

Following are the method to the given question:

def copy(s, n):#defining a method copy that takes two parameters

   if n <= 0:#definig if to compare n value is less than equal to 0

       return ''#return space  

   else:#definig else block  

       return s + copy(s, n-1)#use recursive method that return value

print(copy("by",2))#calling method and print value

print(copy("ta",2))#calling method and print value

print(copy("good by ",2))#calling method and print value

Output:

byby

tata

good by good by

Explanation:

In this code, a method "copy" is declared that takes two parameters that are "s and n" inside the method a conditional statement is used which can be defined as follows.

In the if block is used "n" variable that checks n value which is less than equal to 0 if it is true it will return a space value.

In the else block it use the recursive method that returns a value which is a copy of s that is concatenated together.

You might be interested in
In the early 1800's, a “computer" was not a machine, it was a person who did math
balu736 [363]

Answer:

True

brainly needs more words apparently

7 0
3 years ago
Read 2 more answers
Case 2-2 Jack has a computer at home that he uses to access the Internet, store and edit personal photos, and create and edit do
bekas [8.4K]

Answer:

Check button under error checking

Explanation:

Under the Tools tab there are two options:

Error checking and Optimize and defragment drive option.

clicking the check button with administrative permission under error checking option will examine the hard drive for errors.

3 0
2 years ago
In 3-5 sentences, describe how you would insert a graph in your word-processing document.
Allisa [31]

Answer:

Click the “Insert” tab, then click the “Chart” button on the Illustrations section to open the “Insert Chart” pop-up window.

Select the type of graph to add to the document, such as a pie chart or bar graph. ...

Click “OK” and Word adds a chart with generic data points to the document.

Explanation:

3 0
3 years ago
Choose all that apply.
stiks02 [169]

Answer:

choose all that apply

Explanation:

7 0
3 years ago
List four significant differences between a file-processing system and a database management system (DBMS).
melisa1 [442]

Answer is given below

Explanation:

differences between a file-processing system and a database management system is given below

file-processing system

  • File system is a software that manages and organizes the files in a storage medium within a computer.
  • It doesn’t provide backup and recovery of data if it is lost.
  • There is less data consistency in file system.
  • File systems provide less security in comparison to DBMS.
  • It is less complex as compared to DBMS.

database management system

  • DBMS is a software for managing the database
  • It provides backup and recovery of data even if it is lost.
  • DBMS has more security mechanisms as compared to file system
  • It has more complexity in handling as compared to file system.
  • There is more data consistency because of the process of normalization.
7 0
3 years ago
Other questions:
  • Two electronics students are discussing static electricity and electric current. Student A says that a basic property of static
    12·1 answer
  • In this story, the reader is strongly encouraged to believe that Skidmore is guilty of poisoning his brother Manchester. Explain
    6·1 answer
  • Which of the following is an example of a good listening skill? A. Replying to the caller as "you" rather than using his or her
    9·2 answers
  • In Windows Vista, the Run command can be found in which application?
    6·1 answer
  • Which of the following code segments could be used to skip the first two characters of an input line (they may or may not be whi
    13·1 answer
  • How to get the home button on your screen?
    13·1 answer
  • Given an array a, write an expression that refers to the first element of the array .
    5·1 answer
  • The___ allows you quickly access features such as formatting, charting, tables, and totals
    11·1 answer
  • What is an operating system?<br>​
    11·2 answers
  • Which statement about analog and digital images is true?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!