QUIZ 1 COMP9021 PRINCIPLES OF PROGRAMMING $ python3 quiz_1.py Enter two integers: 0 4 The generated mapping is: {2: 3, 4: 1} The keys are, from smallest to largest: [2, 4] Properly ordered, the cycles given by the mapping are: [] The (triply ordered) reversed dictionary per lengths is: {1: {1: [4], 3: [2]}} $ python3 quiz_1.py Enter two integers: 0 6 The generated mapping is: {1: 1, 3: 3, 5: 6, 6: 6} The keys are, from smallest to largest: [1, 3, 5, 6] Properly ordered, the cycles given by the mapping are: [[1], [3], [6]] The (triply ordered) reversed dictionary per lengths is: {1: {1: [1], 3: [3]}, 2: {6: [5, 6]}} $ python3 quiz_1.py Enter two integers: 0 11 The generated mapping is: {2: 7, 3: 11, 4: 10, 5: 10, 7: 2, 9: 5, 10: 10, 11: 5} The keys are, from smallest to largest: [2, 3, 4, 5, 7, 9, 10, 11] Properly ordered, the cycles given by the mapping are: [[2, 7], [10]] The (triply ordered) reversed dictionary per lengths is: {1: {2: [7], 7: [2], 11: [3]}, 2: {5: [9, 11]}, 3: {10: [4, 5, 10]}} Date: Term 3, 2020. 2 COMP9021 PRINCIPLES OF PROGRAMMING $ python3 quiz_1.py Enter two integers: 10 9 The generated mapping is: {1: 5, 2: 6, 3: 5, 4: 5, 5: 6, 6: 7, 7: 1, 9: 6} The keys are, from smallest to largest: [1, 2, 3, 4, 5, 6, 7, 9] Properly ordered, the cycles given by the mapping are: [[1, 5, 6, 7]] The (triply ordered) reversed dictionary per lengths is: {1: {1: [7], 7: [6]}, 3: {5: [1, 3, 4], 6: [2, 5, 9]}} $ python3 quiz_1.py Enter two integers: 20 11 The generated mapping is: {2: 4, 3: 9, 4: 4, 5: 8, 6: 2, 7: 5, 8: 11, 9: 1, 10: 10, 11: 5} The keys are, from smallest to largest: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11] Properly ordered, the cycles given by the mapping are: [[4], [5, 8, 11], [10]] The (triply ordered) reversed dictionary per lengths is: {1: {1: [9], 2: [6], 8: [5], 9: [3], 10: [10], 11: [8]}, 2: {4: [2, 4], 5: [7, 11]}} $ python3 quiz_1.py Enter two integers: 50 15 The generated mapping is: {1: 5, 2: 14, 3: 15, 4: 3, 5: 5, 6: 5, 7: 15, 8: 6, 9: 10, 10: 15, 11: 12, 12: 15, 13: 14, 14: 8, 15: 9} The keys are, from smallest to largest: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] Properly ordered, the cycles given by the mapping are: [[5], [9, 10, 15]] The (triply ordered) reversed dictionary per lengths is: {1: {3: [4], 6: [8], 8: [14], 9: [15], 10: [9], 12: [11]}, 2: {14: [2, 13]}, 3: {5: [1, 5, 6]}, 4: {15: [3, 7, 10, 12]}}
欢迎咨询51作业君