首页 > > 详细

辅导COMP9021程序、Python语言程序调试、辅导Python编程辅导Python程序|辅导Python程序

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+51*31*58*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:

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!