Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question One: 15 marks What will be the output of the following snippets of python code? Write down the exact output, including all brackets, parentheses,

image text in transcribed

Question One: 15 marks What will be the output of the following snippets of python code? Write down the exact output, including all brackets, parentheses, braces, quotes and commas ([], 0), {}, ",""...). [3 mark for each Question] Justify your answer with suitable explanation. (1) m=[[X,X+1,x+2) for x in range(0,3)] print(m) (2) def myfunc(a): a = a + 2 a = a* 2 return a print(myfunc(2) (3) rec={'Name':'Python', 'Age:20, 'Addr':'SK01', 'Country':'India') id1=id(rec) del rec rec={'Name':'C++', 'Age":40, 'Addr':'SKO2', 'Country':'USA'} id=id(rec) print(id1 == id) (4) def Changer(P, Q=5): PEP/Q Q=P% print (P,"#", o) return P A=100 B=10 A=Changer(A,B) print (A, "$", B) B=Changer(B) print (A, "$", B) (5) def DISPLAY(mystr): L = len(mystr) str2=' str3=1 for i in range(0,1,1): str2=str2+mystri for ch in str2: if ch>='R' and ch

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

Identify the four parts of the model for writing objectives.

Answered: 1 week ago

Question

What did they do? What did they say?

Answered: 1 week ago