Example: $ python tile.py 4 tommy Error: tile height must be an odd number Example: $ python tile.py 3 thisnameistoolong Error: name must fit within 9 characters Example: $ python tile.py 5 againthisnameistoolong Error: name must fit within 15 characters Example: $ python tile.py 5 tommy +| +- -|++ | ++ | + -TOMMY--- --- +++|++|+--- Example: $ python tile.py 7 daria +|++|++| + ---+|++|++ |++|++|+ -DARIA- ---+|++|++ |++|++|+-- + |++|++|+

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Can you help me to write this program in python, please

Example:
$ python tile.py 4 tommy
Error: tile height must be an odd number
Example:
python tile.py 3 thisnameistoolong
Error: name must fit within 9 characters
Example:
$ python tile.py 5 againthisnameistoolong
Error: name must fit within 15 characters
Example:
$ python tile.py 5 tommy
---
+|++| ++| +
-TOMMY--
+ ++
++
Example:
$ python tile.py 7 daria
++
+++.
+| ++ | ++ | ++ | ++ | +
-DARIA-
++|++|++|++ | +
++
++
Transcribed Image Text:Example: $ python tile.py 4 tommy Error: tile height must be an odd number Example: python tile.py 3 thisnameistoolong Error: name must fit within 9 characters Example: $ python tile.py 5 againthisnameistoolong Error: name must fit within 15 characters Example: $ python tile.py 5 tommy --- +|++| ++| + -TOMMY-- + ++ ++ Example: $ python tile.py 7 daria ++ +++. +| ++ | ++ | ++ | ++ | + -DARIA- ++|++|++|++ | + ++ ++
A linoleum tile company has recently set up a new online store and to showcase its move into the
digital space, it wishes to allow its members to create custom digital tiles. An example of a digital tile
is as follows.
++
-TOMMY
++
++|
The tile company has asked you to write a program which will output a digital tile based on some
command line arguments.
• The first command line argument is the height of the tile
• The second command line argument is a member's name which should be included in capitals
in the center of the tile
There are some constraints to keep in mind about the size of the tile.
• The height of the tile must be an odd integer.
• The width of the tile is exactly 3 times the height of the tile
• The member's name must fit within the width of the tile, otherwise the tile cannot be
generated
You can assume all command line arguments will be provided and the first argument can be cast to
an integer.
In Python, you can construct repeated strings with string multiplication. You may use this in your
solution.
'a'
* 4 ==
'aaaa'
'b' * 6
'bbbbbb'
==
Transcribed Image Text:A linoleum tile company has recently set up a new online store and to showcase its move into the digital space, it wishes to allow its members to create custom digital tiles. An example of a digital tile is as follows. ++ -TOMMY ++ ++| The tile company has asked you to write a program which will output a digital tile based on some command line arguments. • The first command line argument is the height of the tile • The second command line argument is a member's name which should be included in capitals in the center of the tile There are some constraints to keep in mind about the size of the tile. • The height of the tile must be an odd integer. • The width of the tile is exactly 3 times the height of the tile • The member's name must fit within the width of the tile, otherwise the tile cannot be generated You can assume all command line arguments will be provided and the first argument can be cast to an integer. In Python, you can construct repeated strings with string multiplication. You may use this in your solution. 'a' * 4 == 'aaaa' 'b' * 6 'bbbbbb' ==
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

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

I tried, but it is not run

[user@sahara ~]$ python3 tile.py
Traceback (most recent call last):
File "/home/tile.py", line 4, in <module>
height
IndexError: list index out of range
int(args[1])
[user@sahara ~]$ |
Transcribed Image Text:[user@sahara ~]$ python3 tile.py Traceback (most recent call last): File "/home/tile.py", line 4, in <module> height IndexError: list index out of range int(args[1]) [user@sahara ~]$ |
Solution
Bartleby Expert
SEE SOLUTION
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY