讲解 COMP9021 QUIZ 1
Posted 实诚人病
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了讲解 COMP9021 QUIZ 1相关的知识,希望对你有一定的参考价值。
QUIZ 1
COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_1.py
Enter two integers, the second one being strictly positive: 0 1
Here are the generated widths:
[7]
Here are the generated symbols:
[\'&\']
Here are the generated repetitions:
[1]
Here is the input as a pattern:
7&1
Here is the input as a dictionary:
(7, 1): \'&\'
Here is the input as an amazing picture:
|&&&&&&&|
$ python3 quiz_1.py
Enter two integers, the second one being strictly positive: 10 2
Here are the generated widths:
[1, 1]
Here are the generated symbols:
[\'&\', \'$\']
Here are the generated repetitions:
[8, 8]
Here is the input as a pattern:
1&81$8
Due to identical pairs of numbers, the input cannot be represented as a dictionary.
Here is the input as an amazing picture:
|&|&|&|&|&|&|&|&|
|$|$|$|$|$|$|$|$|
Date: Trimester 2, 2021.
2 COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_1.py
Enter two integers, the second one being strictly positive: 20 3
Here are the generated widths:
[3, 6, 1]
Here are the generated symbols:
[\'%\', \'+\', \'&\']
Here are the generated repetitions:
[2, 3, 7]
Here is the input as a pattern:
3%26+31&7
Here is the input as a dictionary:
(3, 2): \'%\', (6, 3): \'+\', (1, 7): \'&\'
Here is the input as an amazing picture:
|%%%|%%%|
|++++++|++++++|++++++|
|&|&|&|&|&|&|&|
$ python3 quiz_1.py
Enter two integers, the second one being strictly positive: 50 4
Here are the generated widths:
[8, 4, 2, 4]
Here are the generated symbols:
[\'%\', \'*\', \'-\', \'-\']
Here are the generated repetitions:
[6, 6, 6, 2]
Here is the input as a pattern:
8%64*62-64-2
Here is the input as a dictionary:
(8, 6): \'%\', (4, 6): \'*\', (2, 6): \'-\', (4, 2): \'-\'
Here is the input as an amazing picture:
|%%%%%%%%|%%%%%%%%|%%%%%%%%|%%%%%%%%|%%%%%%%%|%%%%%%%%|
** | ** | ** | ** | ** | ** |
---|
QUIZ 1 3
$ python3 quiz_1.py
Enter two integers, the second one being strictly positive: 100 5
Here are the generated widths:
[3, 3, 7, 9, 8]
Here are the generated symbols:
[\'*\', \'&\', \'-\', \'@\', \'%\']
Here are the generated repetitions:
[8, 6, 2, 2, 1]
Here is the input as a pattern:
3*83&67-29@28%1
Here is the input as a dictionary:
(3, 8): \'*\', (3, 6): \'&\', (7, 2): \'-\', (9, 2): \'@\', (8, 1): \'%\'
Here is the input as an amazing picture:
4 COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_1.py
Enter two integers, the second one being strictly positive: 200 10
Here are the generated widths:
[1, 3, 1, 1, 8, 4, 7, 8, 8, 3]
Here are the generated symbols:
[\'$\', \'+\', \'\', \'\', \'*\', \'@\', \'^\', \'&\', \'%\', \'#\']
Here are the generated repetitions:
[1, 5, 3, 5, 4, 5, 2, 4, 2, 8]
Here is the input as a pattern:
1$13+513158*44@57^28&48%23#8
Due to identical pairs of numbers, the input cannot be represented as a dictionary.
Here is the input as an amazing picture:
WX:codehelp
以上是关于讲解 COMP9021 QUIZ 1的主要内容,如果未能解决你的问题,请参考以下文章