Professional Documents
Culture Documents
Assignment 2.ipynb - Colaboratory
Assignment 2.ipynb - Colaboratory
ipynb - Colaboratory
For your second assignment, you should use a loop to iterate through the tuple numbers . For each
of the numbers, you should perform up to 3 operations:
After these operations are performed, append the number to output_list . When the loop is
finished, print output_list .
hint: your resulting list should be [-25, 16, 21, 14, 6, 0, 23, -2, 24, 2, -18, 24, 2, 14, -22, -4, 22]
numbers = (-25, -16, 21, 14, 6, -1, 23, -2, -24, 2, -18, 24, 1, 7, -22, -5, 22)
add_one = set([-1, -12, 10, -5, 25])
double = set([1, 12, 0, 7, 17])
negate = set([-24, -16, -3, 12, 15])
output_list = []
https://colab.research.google.com/drive/1S9dTMk7P2GRIwBo89LPEIsCn110cX2CL?usp=sharing#scrollTo=0WT91pfsvS68&printMode=true 1/2
1/16/23, 9:23 AM Assignment 2.ipynb - Colaboratory
https://colab.research.google.com/drive/1S9dTMk7P2GRIwBo89LPEIsCn110cX2CL?usp=sharing#scrollTo=0WT91pfsvS68&printMode=true 2/2