Computer Science With Python Chapter 1 Review Of Phython
  • Sponsor Area

    NCERT Solution For Class 12 Computer And Communication Technology Computer Science With Python

    Review Of Phython Here is the CBSE Computer And Communication Technology Chapter 1 for Class 12 students. Summary and detailed explanation of the lesson, including the definitions of difficult words. All of the exercises and questions and answers from the lesson's back end have been completed. NCERT Solutions for Class 12 Computer And Communication Technology Review Of Phython Chapter 1 NCERT Solutions for Class 12 Computer And Communication Technology Review Of Phython Chapter 1 The following is a summary in Hindi and English for the academic year 2021-2022. You can save these solutions to your computer or use the Class 12 Computer And Communication Technology.

    Question 1
    CBSEENCO12011531
    Question 2
    CBSEENCO12011532

    Name the Python Library modules which need to be imported to invoke the following functions:
    (i) ceil()
    (ii) randint()

    Solution

    (i) Ceil() function requires math module.
    (ii) randint() function requires randon module.

    Question 3
    CBSEENCO12011533

    Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.

    TEXT=''GREAT
    DAY''
    for T in range[0,7]:
    print TEXT(T)
    print T+TEXT

    Solution
    TEXT = 'GREAT'
    DAY = ''
    for T in range (0,7):
    	print TEXT [T]
    	print T, TEXT

    The range(0,7) will give a runtime error as the index is out of range. It should be a range(0,6).

    Question 6
    CBSEENCO12011536
    Question 8
    CBSEENCO12011579

    Name the Python Library modules which need to be imported to invoke the following functions
    (i) floor()
    (ii) randint()

    Solution

    Python Library modules which need to import to invoke the given functions are:
    (i) math
    (ii) random

    Question 9
    CBSEENCO12011580

    Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.

    STRING=''WELCOME
    NOTE''
    for S in range[0,8]:
    print STRING(S)
    print S+STRING

    Solution
    STRING= 'WELCOME'
    NOTE=''
    for S in range (0,8):
    print STRING [S]
    print S, STRING
    Also, range(0,8) will give a runtime error as the index is out of range. It should be range(0,7)
    Question 13
    CBSEENCO12011590

    Write definition of a method EvenSum(NUMBERS) to add those values in the list of NUMBERS, which are odd.

    Solution
    def EvenSum(NUMBERS):
    	n=len(NUMBERS)
    	s=0
    	for i in range(n):
    		if (i%2!=0):
    			s=s+NUMBERS[i]
    			print(s)
    Question 14
    CBSEENCO12011626

    Out of the following, find those identifiers, which can not be used for naming Variable or Functions in a Python program:

    _Cost, Price*Qty, float, Switch,
    Address One, Delete, Number12, do

    Solution
    Price*Qty, float, Address One, do

    These above identifiers cannot be used for naming Variable or Functions in a python program.

    Question 15
    CBSEENCO12011627

    Name the Python Library modules which need to be imported to invoke the following functions
    (i) load()
    (ii) pow()

    Solution

    The Python Library modules which need to be imported to invoke the given functions are,

    (i) pickle

    (ii) math

    Sponsor Area

    Question 21
    CBSEENCO12011678

    How is __init__() different from __del__() ?

    Solution

    __init__() is the class constructor or initialization method which is automatically invoked when we create a new instance of a class.

    __del__() is a destructor which is automatically invoked when an object (instance) goes out of scope.

    For Example:

    class Sample:
    	def __init__(self):
    		self.data = 79
    		print('Data:',self.data,'created')
    	def __del__(self):
    		print('Data:',self.data,'deleted')
    s = Sample()
    del s

    Question 23
    CBSEENCO12011680

    Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.

    def Tot(Number) #Method to find Total
    	Sum=0
    	for C in Range (1, Number+1):
    		Sum+=C
    		RETURN Sum
    print Tot[3] #Function Calls
    print Tot[6]

    Solution
    def Tot(Number): #Method to find Total #Error 1
        Sum=0
        for C in range (1, Number+1):      #Error 2
            Sum+=C
        return Sum                         #Error 3
    print Tot(3)   #Function Call          #Error 4
    print Tot(6)                           #Error 4

    Mock Test Series

    Sponsor Area

    Sponsor Area

    NCERT Book Store

    NCERT Sample Papers

    Entrance Exams Preparation

    21