QUIZ 4 COMP9021 PRINCIPLES OF PROGRAMMING $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: 1 In base 2, 1 reads as 1 Incorrect encoding! $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: 12345 In base 2, 12345 reads as 11000000111001 Incorrect encoding! $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: 3 In base 2, 3 reads as 11 It encodes: [1] $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: [1] In base 2, [1] reads as [1] It is encoded by 3 $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: 51315663 In base 2, 51315663 reads as 11000011110000001111001111 It encodes: [4891] $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: [4891] In base 2, [4891] reads as [1001100011011] It is encoded by 51315663 $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: 424896 In base 2, 424896 reads as 1100111101111000000 It encodes: [11, 24] $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: [11, 24] In base 2, [11, 24] reads as [1011, 11000] It is encoded by 424896 Date: Term 3, 2020. 2 COMP9021 PRINCIPLES OF PROGRAMMING $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: 857310204 In base 2, 857310204 reads as 110011000110011000001111111100 It encodes: [10, 20, 30] $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: [10, 20, 30] In base 2, [10, 20, 30] reads as [1010, 10100, 11110] It is encoded by 857310204 $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: 13609683913728 In base 2, 13609683913728 reads as 11000110000011000000011000000000110000000000 It encodes: [2, 4, 8, 16, 32] $ python3 quiz_4.py Input either a strictly positive integer or a nonempty list of strictly positive integers: [2, 4, 8, 16, 32] In base 2, [2, 4, 8, 16, 32] reads as [10, 100, 1000, 10000, 100000] It is encoded by 13609683913728
欢迎咨询51作业君