QUIZ 1
COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_1.py
Enter two integers, the second one being between 1 and 10 included: 1 8
Here is the list of symbols:
['@', '!', '$', '~', '#', '%', '&', '+']
Here is the list of how many times each of them is to be displayed:
[7, 4, 2, 8, 1, 7, 7, 1]
What is your favourite symbol? #
How big do you want the gap to be (should be 1 or more)? 4
What is the name of the file containing the instructions? instructions_1.txt
I have a drawing for you...
It is made of #, repeated once,
placed in the four corners of a rectangle,
with a gap of 4 both horizontally and vertically.
# #
# #
Like it?
I am now going to process the instructions in the file.
**********
____
+++++
Ok, but not a great drawing...
Date: Trimester 2, 2020.
2 COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_1.py
Enter two integers, the second one being between 1 and 10 included: 2 6
Here is the list of symbols:
['~', '!', '*', '@', '&', '^']
Here is the list of how many times each of them is to be displayed:
[5, 4, 1, 3, 7, 7]
What is your favourite symbol? ^
How big do you want the gap to be (should be 1 or more)? 1
What is the name of the file containing the instructions? instructions_2.txt
I have a drawing for you...
It is made of ^, repeated 7 times,
placed in the four corners of a rectangle,
with a gap of 1 both horizontally and vertically.
^^^^^^^ ^^^^^^^
^^^^^^^ ^^^^^^^
Like it?
I am now going to process the instructions in the file.
^^^
%%%%%
++++++++
++++
==
Ok, but not a great drawing...
QUIZ 1 3
$ python3 quiz_1.py
Enter two integers, the second one being between 1 and 10 included: 6 10
Here is the list of symbols:
['+', '!', '&', '^', '@', '~', '$', '#', '*', '%']
Here is the list of how many times each of them is to be displayed:
[6, 1, 5, 8, 4, 7, 9, 9, 2, 4]
What is your favourite symbol? $
How big do you want the gap to be (should be 1 or more)? 5
What is the name of the file containing the instructions? some_instructions.txt
I have a drawing for you...
It is made of $, repeated 9 times,
placed in the four corners of a rectangle,
with a gap of 5 both horizontally and vertically.
$$$$$$$$$ $$$$$$$$$
$$$$$$$$$ $$$$$$$$$
Like it?
I am now going to process the instructions in the file.
***********************
((((((((
&&&&&&
)))))))))))))))))
+
**************
###
$$$
%%%%
Ok, but not a great drawing...
版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。