+ All Categories
Home > Documents > HOLIDAYS HOMEWORK 2020-21 CLASS XII COMPUTER SCIENCEdavsreshtha.com/File/4/CLASS 12 HOLIDAYS...

HOLIDAYS HOMEWORK 2020-21 CLASS XII COMPUTER SCIENCEdavsreshtha.com/File/4/CLASS 12 HOLIDAYS...

Date post: 24-Oct-2020
Category:
Upload: others
View: 9 times
Download: 0 times
Share this document with a friend
21
HOLIDAYS HOMEWORK – 2020-21 CLASS XII COMPUTER SCIENCE REVISION OF CLASS 11 1. What will be the output of the following code? dict = {} dict[1] = 11 dict['1'] = 20 dict[1]= dict[1]+1 count = 0 for i in dict: count += dict[i] print(count) 2. What will be the output of the following code? dict = {1:'X', 2:'Y', 3:'Z'} del dict[1] dict[1] = 'D' del dict[2] print(len(dict)) 3. What is the output of the following code? dict={1:'dict',2:'B',3:'C'} for i,j in dict.items(): print(i,j,end=' ') numbers={1:5,2:22} letters={3:'B'} comb={}
Transcript
  • HOLIDAYS HOMEWORK – 2020-21

    CLASS XII

    COMPUTER SCIENCE

    REVISION OF CLASS 11

    1. What will be the output of the following code?

    dict = {}

    dict[1] = 11

    dict['1'] = 20

    dict[1]= dict[1]+1

    count = 0

    for i in dict:

    count += dict[i]

    print(count)

    2. What will be the output of the following code?

    dict = {1:'X', 2:'Y', 3:'Z'}

    del dict[1]

    dict[1] = 'D'

    del dict[2]

    print(len(dict))

    3. What is the output of the following code?

    dict={1:'dict',2:'B',3:'C'}

    for i,j in dict.items():

    print(i,j,end=' ')

    numbers={1:5,2:22}

    letters={3:'B'}

    comb={}

  • comb['numbers'] = numbers

    comb['letters'] = letters

    print(comb)

    4. What will be the output of the following code snippet?

    dict = {'Name' : 'Python'}

    id1 = id(dict)

    del dict

    dict = {'Name' : 'Python'}

    id2 = id(dict)

    print(id1 == id2)

    5. Given the following dictionary:

    inventory = {

    'gold' : 500,

    'pouch' : ['twine', 'gemstone'],

    }

    Try to do the followings:

    *Add a key to inventory called 'packet'

    *Set the value of 'packet' to 'seashell', 'strange berry'

    *sort()the items in the list stored under the 'pouch' key

    6. Write definition of a method/function AddOddEven(VALUES) to display sum of odd and even values separately from the list of VALUES. For example, If the VALUES contain [15,26,37,10,22,13], The function should display Even Sum: 58 Odd Sum: 65

  • FUNCTIONS

    1. Write the output of the following code?

    def myfunc(a, b=5, c=10):

    print('a is', a, 'and b is', b, 'and c is', c)

    myfunc(3, 7)

    myfunc(25, c = 24)

    myfunc(c = 50, a = 10)

    2. Write the output of the following code?

    x = 150

    def myfunc():

    global x

    print('x is', x)

    x=2

    print('Changed global x to', x)

    myfunc()

    print('Value of x is', x)

    3. Write the output of the following statements.

    print("xyz DEF".capitalize( ))

    print('*', "python".center(7), '*')

    print("ayybcyzxcxyy".count('yy'))

    print("Hello {0} and {1}".format('python', 'java'))

    print('while'.isidentifier())

    print('5.1'.isnumeric())

    DATA FILE HANDLING

    1. What Will Be the Output of the Following Code Snippet?

    fo = open("myfile.txt", "w+")

    #name gives the name of the file linked with fo

    print ("File name is : ", fo.name)

  • seq="File handling is easy in python"

    fo.writelines(seq)

    fo.seek(0,0)

    for line in fo:

    print (line)

    fo.close()

    2. Observe the following code and answer the questions that follow: File = open("Mydata","a") _____________________ #Blank1 File.close( ) i. What type (Text/Binary) of file is Mydata? ii. Fill the Blank 1 with statement to write “ABC” in the file “Mydata”

    3. Write a Python Program to Count the Number of Blank Spaces in a Text File.

    4. Write a Python Program to Read a File and Capitalize the First Letter

    of Every Word in the File.

    5. Write a Python Program to Read the Contents of a File in Reverse Order.

    6. Write a function in Python to search and display details of all those students, whose

    stream is “HUMANITIES” from pickled file “Student.dat”. Assuming the pickled file

    containing following data for the students:-

    Roll, Name, Stream, Percent

    7. Write a function MULTIPLEX( ) in python to search and delete all the content in a

    pickled file CINEMA.DAT, where MTYPE is matching with the value ‘Comedy’. File

    contains following details about Movies – (MNO,MNAME, MTYPE)

  • Holiday Homework Class XII

    Chemistry

    Haloalkenes and Haloarenes

    1. Write the structures of the following organic halogen compounds. (i) 2-Chloro-3-

    methylpentane (ii) p-Bromochlorobenzene

    2. What are ambident nucleophiles? Explain with an example.

    3. Which compound in each of the following pairs will react faster in SN2 reaction with –

    OH? (i) CH3Br or CH3I (ii) (CH3)3CCl or CH3Cl

    4. Write the mechanism of the following reaction: nBuBr + KCN nBuCN

    5. Out of C6H5CH2Cl and C6H5CHClC6H5, which is more easily hydrolysed by aqueous

    KOH?

    6. What happens when (i) n-butyl chloride is treated with alcoholic KOH, (ii)

    bromobenzene is treated with Mg in the presence of dry ether.

    7. What are: (i)Enantiomers (ii)Racemic Mixture.

    8. Which one of the following compound is more easily hydrolysed by KOH and why?

    CH3CHClCH2CH3 or CH3CH2CH2Cl

    9.Give reasons -

    (a) Allyl chloride is hydrolysed more readily than n-propyl chloride.

    (b) Vinyl chloride is hydrolysed more slowly than ethyl chloride.

    (c) Ethyl iodide undergoes SN2 reaction faster than ethyl Bromide.

    (d) (+) 2-butanol is optically inactive.

    10. An optically active compounds having molecular formula C7H15Br reacts with aqueous

    KOH to give a racemic mixture of products. Write the mechanism involved.

    11. What happens when –

    (a) Ethyl Chloride is treated with NaI in presence of acetone.

    (b) Chloro benzene is treated with Na metal in presence of dry ether.

    (c) Methyl Chloride is treated with KNO2.

    12. Distinguish between –

    (a) Ethyl Chloride and Vinyl chloride.

    (b) Chloro benzene and benzyl chloride

    13. Arrange the following in order of decreasing boiling point

    (a) n-pentyl chloride, iso-pentyl chloride, neo-pentyl chloride

  • Alcohols Phenols and Ethers

    1. Explain why propanol has higher boiling point than that of the hydrocarbon, butane?

    2. Give the equations of reactions for the preparation of phenol from cumene.

    3. Explain the following with an example.

    (i) Kolbe’s reaction.

    (ii) Reimer-Tiemann reaction.

    4. Give equations of the following reactions: (i) Oxidation of propan-1-ol with alkaline

    KMnO4 solution. (ii) Bromine in CS2 with phenol.

    5. How are the following conversions carried out? (i) Benzyl chloride → Benzyl

    alcohol. (ii) Ethyl magnesium chloride → Propan-1-ol.

    6. Write the equation of the reaction of hydrogen iodide with: (i) methoxybenzene and

    (ii) benzyl ethyl ether.

    7. Write equations of the following reactions: (i) Friedel-Crafts reaction – alkylation of

    anisole. (ii) Nitration of anisole.

    Solutions

    1. An aqueous solution of 2% non-volatile solute exerts a pressure of 1.004 bar at

    the normal boiling point of the solvent. What is the molar mass of the solute?

    2. Heptane and octane form an ideal solution. At 373 K, the vapour pressures of the

    two liquid components are 105.2 kPa and 46.8 kPa respectively. What will be the

    vapour pressure of a mixture of 26.0 g of heptane and 35 g of octane?

    3. The vapour pressure of water is 12.3 kPa at 300 K. Calculate vapour pressure of 1

    molal solution of a non-volatile solute in it.

    4. Calculate the mass of a non-volatile solute (molar mass 40 g mol–1) which should

    be dissolved in 114 g octane to reduce its vapour pressure to 80%.

    5. A solution containing 30 g of non-volatile solute exactly in 90 g of water has a

    vapour pressure of 2.8 kPa at 298 K. Further, 18 g of water is then added to the

    solution and the new vapour pressure becomes 2.9 kPa at 298 K. Calculate: (i)

    molar mass of the solute (ii) vapour pressure of water at 298 K.

    6. A 5% solution (by mass) of cane sugar in water has freezing point of 271K.

    Calculate the freezing point of 5% glucose in water if freezing point of pure water

    is 273.15 K.


Recommended