Download as pdf
Download as pdf
You are on page 1of 5
. 4 >» ,O | > PAPER 4 Yj a Hours] 2 . ? {Maximum Marks: 70 |. (@ Write the output of the given statements: Gace = (country’s ['USA', “UK, “INDIA, "NEPAL*], Print (dict. keys()) (6) Name the Python library modules whi (4) sqrt() (44) randint () (©) What is indentation? “year's (2012, 2012, 2013, 2014, 2014] ich need to be imported to invoke the following functions ig the syntactical errors (if any). Underline each correction: def chksun: Xeinput("Enter a Number") if x %2 <0: for i range (2*): print ¢ oop else: print “# (€) Write the output of the given code snippet: def Findoutput(): ython” eee 1. swapcase() eked count=count+1 print (x) Findoutput() () Find and write the output of the following python code: def fun(text): kelen(text) for 2 in range(0,k): if(text [i]. isupper()), memstext[i]. lover() elif text[i] -isalpha(); metext[i] .upper() Practice Papers 233 else: meme @! print(m) fun( ‘Togetherscom! ') 6 Bred on the following python code, find out the hel Correct outputs) from the options (i) 10 (iv), Also, find oatte minimum and the maximum value that car be assigned tothe variable Guess woes in the code at the time when Value of Tum is 3, import random Result=["GOLO", "SILVER" Gevit-9 Gues: for Turn in range(1,4); Guess-random. randint (0, Turn brine (Getit-Guess ,Result[Guess], ' SOLD*9GOLD*sSILVER® " SGOLD*7BRONZE*SGOLD* ' SCOLD*SSILVER*9GOLD* "IdexError: List in 1 Name a python " Weaity the valid 0 Day=(1:'mon dex out of range keyword is used for Iteration? declaration of dictionary? ‘) Daye "monday’,2:'mesday’,3:'wednesday’] PH Dey-(1'monday,2Yuesday’3 wednesday} * he following code and answer the questions that follow: Fle» open(*hydata”,“2") Blanka Ale. close. 0) " DPE of file is Mydata (TexvBinary)? “Mydata” 4 * pile Blank 1 with statement to write “ABC” in the file “Mydata “IS it of the given code answes the

You might also like