Question: Write a program (Filename: odd.py) that generates all odd numbers from 1 to n. Set n in the beginning of the program and use a

 Write a program (Filename: odd.py) that generates all odd numbers from

Write a program (Filename: odd.py) that generates all odd numbers from 1 to n. Set n in the beginning of the program and use a while or for loop to compute the numbers. Make sure that if n is an even number, the largest generated odd number is n-1. Note: you are required to use a while or for loop for this task but you cannot use range) function for this question. For example: If n-11, the program will print: 1, 3, 5, 7, 9, 11 If n 10, the program will print: 1, 3, 5,7,9 Create a Python program (Filename: transpose py) to transpose a two level nested list. Given A 1,2,3,4],[5,6,7,81,(9,10,11,121, your code will transpose the rows to columns and print the new list. The result should be: 1,5,9,[2,6,10,3,7,11,14,8,12]] Note: Please write your code using loop. Manual calculation will get 0 points Given a list A and a value X, create a Python program (Filename: two_sum.py) to test whether there are two elements in A whose summation is X. For example: If A 1,2,3,4,5,6,7] and X-8, your code prints yes, it is If A [1,2,3,4,5,6,7] and X-21, your code prints no, it is not. Note: you might need to check the summation of each pair in A

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!