Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

[[ Answer the following and include the working of the snippets in the box given.

[[

1. What will be the value of X in the following Python expression? Show the
working.

2. Suppose list1 is [1, 3, 2], then what is list1 * 2? Show the working.

3. What will be the output of the following Python code? Show the working.

4. What will be the output of this program? Derive the answer with working.
5. Insert the correct syntax to assign the same value to all three variables in one code
line.

x ___ y ___ z ____34+29j

6. Create a variable named carname and assign the value Volvo to it and print the
value of carname. Write the code.

7. What will be the value of the following Python code? Include the working.
Change the code to get the output to “0 1 2 3 4 6 7 8 9 here”.

8. What will be the output of the following Python code? Include the working.

9. What will be the output of the following Python code? Include the working.
Change the code to get the output as “ i am not in if and not in else Block”.
10. What will be the output of the following Python code? Change the code where the
user can see other elif/else output based upon mark input.
[

11. What will be the output of the following Python code? Include the working.
Change the code to get output as “ e e e e e e e…....”

12. Find the error in the following code, mention which line has an error and what is
the error?
13. Find the error in the following code, mention which line has an error and what is
the error?

14. What will be the output of the following Python code? Show working. Rewrite
the code to get output as a) 1 2 4 5 b) 1 2 3 4 5
if

15. What will be the output of the following Python code? Change the code to get the
output as “1 3 5 7 9 11 13 15 17 19 21 23 25 27 29”.

16. Find the error in the following code, mention which line has an error and what is
the error? Change the code to get the output as “A B C D”
17. What will be the output of the following Python code? Change the code to get the
output as of list1 as “[11, 55, 888,44, 33]”

18. What will be the output of the following python code?

19. If I set alarm to tick after 50 hours from now at what time will my alarm tick?
Change the code to make my alarm ring at ‘8am’”
20. What is the output of the following code? Show the logic steps and derive the answer.

21. What is the output of the following code? Show the working logic. Change the code to
get the output as “30”.

22. What is the output of the following code? Change the code to get output as “mym”

23. Find the output of the following code


Output:

Now, change the above code to obtain the output as follows


Write the changed code here:

24. Find the output of the following code?


Output:

Now, change the above code to obtain the output as follows

Write the changed code here:


25. Write the python program from the following flowchart, derive the output by
showing the working and logic.

************************* End of Questions****************************

You might also like