Please write a function named line, which takes two arguments: an integer and a string. The function prints out a line of text, the length of which is specified by the first argument The character used to draw the line should be the first character in the second argument. If the second argument is an empty string, the line should consist of stars. An example of expected behaviour: line (7, "%") line (10, "LOL") line (3, "") %/9/9/9/9/19/% /0/0/0/0/0/0/0 LLLLLLLLLL *** Sample output

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Can you use Python programming language to to this question?

Thanks

Please write a function named line, which takes two arguments: an integer and a string.
The function prints out a line of text, the length of which is specified by the first argument.
The character used to draw the line should be the first character in the second argument.
If the second argument is an empty string, the line should consist of stars.
An example of expected behaviour:
line (7, "%")
line (10, "LOL")
line (3, "")
0/0/0/0/0/0/0/
10/0/0/0/0%%
LLLLLLLLLL
***
Sample output
Transcribed Image Text:Please write a function named line, which takes two arguments: an integer and a string. The function prints out a line of text, the length of which is specified by the first argument. The character used to draw the line should be the first character in the second argument. If the second argument is an empty string, the line should consist of stars. An example of expected behaviour: line (7, "%") line (10, "LOL") line (3, "") 0/0/0/0/0/0/0/ 10/0/0/0/0%% LLLLLLLLLL *** Sample output
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Hello...Its not correct...

TESTS FAILED
Send solution to server
Need help?
✔ Show all
80 %
FAIL:
LineTest:
test_0_main_program_ok
The code for testing the functions should be
placed inside
if _name_ ==
"__main__":
block. The following row should be moved:
line (7, "%")
PASS:
Line Test: test_1_function_exists
PASS:
Line Test:
test_2_function_can_be_called_with_empty_string
X
Transcribed Image Text:TESTS FAILED Send solution to server Need help? ✔ Show all 80 % FAIL: LineTest: test_0_main_program_ok The code for testing the functions should be placed inside if _name_ == "__main__": block. The following row should be moved: line (7, "%") PASS: Line Test: test_1_function_exists PASS: Line Test: test_2_function_can_be_called_with_empty_string X
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education