Top Banner
1 ©Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS] GOVIND VIDYALAYA TAMULIA ====================== General Instruction: The question bank contains the all type of questions. During Preparation of Question paper for Examination, the blue print of question paper must follow. It is mandatory to introduce each question and its each type in preparation of question paper. The Question Bank are Divided in Two Parts(MODULE A+ MODULE B) MODULE A Contains Questions For MID TERM EXAMINATION. MODULE B Contains Questions For FINAL TERM EXAMINATION. ===================================================================================== MODULE-A The following chapters are in portion of Mid Term Examination. UNIT 1:COMPUTER FUNDAMENTALS Chapter 1:-Evolution Of Computer Chapter 2:-Computer Software Chapter 3:-Functions of Operating System Chapter 4:-Number System Chapter 5:-Microprocessor Chapter 6:-Memory and Input/output Ports UNIT 2:PROGRAMMING METHODOLOGY Chapter 1:-Programming Methodology and techniques Chapter 2:-Algorithm and Flowcharts MODULE-B The following chapters are in portion of Final Term Examination. UNIT 3:INTRODUCTION TO PYTHON Chapter 1:-Introduction/Overview of Python Chapter 2:-Input/output in Python Chapter 3:-Operator and Expression In Python Chapter 4:-Working with Math Module Chapter 5:-Branching and Looping in Python Chapter 6:-User-Defined Function in Python UNIT 4:PROGRAMMING WITH PYTHON Chapter 1:-Working with Strings and Lists Chapter 2:-Working with Directories and Tuples Question Bank Session 2014-15 Subject-Computer Science with PYTHON Subject Code-083 STD XI
39

Computer Science Question Bank STD XI Session 2014-15

Dec 17, 2015

Download

Documents

Bhavesh Desai

Computer Science Question Bank STD XI Session 2014-15
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 1

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    GOVIND VIDYALAYA TAMULIA

    ======================

    General Instruction: The question bank contains the all type of questions. During Preparation of Question paper for Examination, the blue print of question paper must follow. It is mandatory to introduce each question and its each type in preparation of question paper. The Question Bank are Divided in Two Parts(MODULE A+ MODULE B) MODULE A Contains Questions For MID TERM EXAMINATION. MODULE B Contains Questions For FINAL TERM EXAMINATION.

    =====================================================================================

    MODULE-A

    The following chapters are in portion of Mid Term Examination. UNIT 1:COMPUTER FUNDAMENTALS

    Chapter 1:-Evolution Of Computer

    Chapter 2:-Computer Software

    Chapter 3:-Functions of Operating System

    Chapter 4:-Number System

    Chapter 5:-Microprocessor

    Chapter 6:-Memory and Input/output Ports UNIT 2:PROGRAMMING METHODOLOGY

    Chapter 1:-Programming Methodology and techniques

    Chapter 2:-Algorithm and Flowcharts

    MODULE-B

    The following chapters are in portion of Final Term Examination.

    UNIT 3:INTRODUCTION TO PYTHON Chapter 1:-Introduction/Overview of Python

    Chapter 2:-Input/output in Python

    Chapter 3:-Operator and Expression In Python

    Chapter 4:-Working with Math Module

    Chapter 5:-Branching and Looping in Python

    Chapter 6:-User-Defined Function in Python UNIT 4:PROGRAMMING WITH PYTHON Chapter 1:-Working with Strings and Lists

    Chapter 2:-Working with Directories and Tuples

    Question Bank Session 2014-15

    Subject-Computer Science with PYTHON Subject Code-083

    STD XI

  • 2

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    Acknowledgement

    The will of God will never take you where Grace of God will not protect you."

    Thank you God for showing me the path. . .

    I owe deep gratitude to the ones who have contributed greatly in completion of this wonderful

    Edition of this Question Bank for Academic Session 2014-15. Foremost, I would like to

    express my sincere gratitude to my Managing Director Sir, Honorable Principal and

    Administrator of This Institution for providing me such a platform and given all possibilities to

    work on challenging areas of technology. I express my heartiest gratitude to all my elders

    guidance, support, and encouragement during the task assign to me.

    It has been a great honor and pleasure for me to do this kind of fruitful task for the better

    output and best academic power towards the students of GOVIND VIDYALAYA TAMULIA.

    I thank all the members of the Department of Computer Science & Information Technology,

    and the Institute, who helped me by providing the necessary resources & support, for the

    completion of my work. Finally, I thank my parents and almighty for their unlimited support

    and strength. Without their dedication and dependability, I was not able to complete my work

    on time.

    Thanking You: Vikash Anand

    HOD-IT/CS & Developer: (Question Bank)

    GOVIND VIDYALAYA TAMULIA

  • 3

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    QUESTION PAPER DESIGN

    Subject Computer Science with Python. (Code-083)

    Time: 3 Hours Max. Marks: 70

    S. No. Typology of Questions

    Very Short

    Answer

    (VSA)

    (1 mark)

    Short

    Answer-I

    (SA-I)

    (2 marks)

    Short

    Answer -II

    (SA-II)

    (3 marks)

    Long

    Answer

    (L.A.)

    (4 marks)

    Total

    Marks

    %

    Weightage

    01 Knowledge Based 3 3 9 13% '

    02 Conceptual

    Understandigs 1 2 2 11 15%

    03 Application Based

    and Inferential type 3 2 1 16 23%

    04 Reasoning Based 1 . 2 2 16 23%

    05 Skill Based 2 2 2 18 26%

    Total 4 11 8 5 70 100%

    Notes: 1. No chapter wise weightage. Care to be taken to cover all the chapters. 2. The above template is only a sample. Suitable internal variations may be made for generating A similar template

    keeping the overall weightage to different form of questions and typology of Questions same.

    3. For Better References (Nos.1) Sample Question Paper are Design Based on Boards Curriculum In the end of this Question Bank.

    4. Abbreviations:

    VSAQ-Very short answer question

    SAQ I -Short answer question

    SAQ II- Short answer question(Type-II)

    LTQ-Long type question.

    Unit No. Unit Name MARKS

    I COMPUTER FUNDAMENTALS 10

    2 PROGRAMMING METHODOLOGY 12

    3 INTRODUCTION TO PYTHON 18

    4 PROGRAMMING WITH PYTHON 30

    TOTAL 70

  • 4

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    MODULE-A

    Unit-1-COMPUTER FUNDAMENTALS Chapter 1:-Evolution Of Computer:

    Short Type Questions [1/2 Marks] [VSAQ/SAQ-I]

    1. What is the function of mouse? 2. Which of the following are parts of the CPU?

    (i) ALU (ii) Memory (iii) Control unit (iv) Input device (v) Printer 3. Results are obtained from computer through its... unit. (Input/Output/CPU)

    4. What are four basic components of a computer system? 5. What is a computer? 6. Who is the father of computer?

    7. In which year was the Pascal's adding machine invented?

    8. Which component is called as the brain of a computer?

    9. What are the main characteristics of a computer? 10. Which part of the computer is responsible for processing?

    11. In which era was the Abacus developed?

    12. List the measurement units of computer speed.

    13. Give at least two examples each of input and output units.

    14. Give two major innovations in the first-generation computers. 15. Give two major innovations in the third-generation computers.

    16. What is booting?

    17. Name the types of computers that NASA and ISRO use to track and control space discovery. 18. Why do people prefer to use micro computers for their personal use?

    19. Where do you see the use of analog computers?

    Chapter 2:-Computer Software:

    20. How many types of software are there? Name them? 21. Name any two programming developers tools.

    22. What is hardware?

    23. Describe the term open source software. 24. What do you understand by the term freeware? 25. What is shareware?

    26. What is proprietary software? 27. Write one example each of proprietary and open source software. 28. What is virus?

    29. What is anti-virus? 30. Give two examples of anti-virus software. 31. Give two examples of disk management tool. 32. Why do you need disk defragmentation?

    Chapter 3:-Functions of Operating System

    33. Expand the following : (i) FCFS (ii) FIFO (iii) OS

    34. Which of the following is not the function(s) of the operating system?

    Processor Management

    Memory Management

    File Management

  • 5

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    None of these

    35. Define First-Come-First-Serve (FCFS) scheduling.

    36. Define compaction.

    37. What is contiguous memory allocation?

    38. What is the degree of multiprogramming?

    39. What is directory?

    40. In the file system, what does a directory contain?

    41. What is the basic function of a mobile OS?

    42. Define a process.

    43. How does a computer program relate to a process?

    44. Define scheduling and scheduler.

    45. What is a Process Control Block (PCB)?

    46. Name the information that a Process Control Block stores.

    47. Name the three types of schedulers.

    Chapter 4:- Number System

    48. Convert (25)10(?)

    49. C o n v e r t ( 3 A B C ) 1 6 ( ? ) 8

    50. Convert (256)8 (?) I0

    51. Convert (110011)2 (?)I0

    52. Convert (2AB) 16 (?)2

    53. Convert (273)8 (?)2

    54. Convert (26)10 (?)16

    55. Convert (38.20,0 (?)2

    56. Convert (372)8 (?),0

    57. Convert (100111010)2 (?)8

    58. Convert (1010111010)2 (?)16

    59. Convert (11001111)2 (?)16

    60. Convert (11001111)2 (?)8

    61. Convert (25)8 (?)Io

    62. Convert (10001)2(?)Io

    63. In which form does each computer store numbers, letters and other characters?

    64. Which of the following is a measurement unit of computer system?

    65. In binary subtraction, 0 1 = 1 and borrow 1 from the next more significant bit. Is it true?

    66. In binary multiplication, 1 x 1 = 1 and no carry or borrow bits. Is it true?

    67. Which categories of data are used in digital computers?

    68. Explain EBCDIC.

    69. Which digits are used in hexadecimal number system?

    70. Which number system is used by computers?

    71. What is the base of octal number system?

    72. What is the base of hexadecimal number system?

    73. Convert (45)10 to binary using division method.

    74. Convert (101101)2 to its decimal equivalent.

    75. Convert (288)10 to its octal equivalent.

  • 6

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    76. Convert (440)8 to its decimal equivalent.

    77. Convert (288)10 to its hexadecimal

    78. Convert (120)16 to its decimal equivalent,

    79. Convert (120)16 to its decimal equivalent,

    80. Convert (120)10 to its Binary equivalent,

    Chapter 5:-Microprocessor

    81. What is a microprocessor?

    82. Name the basic components of a microprocessor.

    83. What is a register?

    84. What is the bit size of recent Intel Pentium computers?

    85. What is clock speed? How is it measured in a computer?

    86. What is a system bus?

    87. What is a control bus?

    88. What is the use of an external bus in a computer?

    89. Define CISC processor.

    90. How does register affect the speed of a computer?

    91. What is logic chip?

    92. Name the components which a microcomputer operates.

    93. Give the full form of :

    (i) CISC (ii) RISC

    94. How is the information transferred in units of a microcomputer?

    95. Will a 64-bit CPU run a 32-bit program?

    96. Write the names of the two microprocessor architectures.

    Chapter 6:-Memory and Input/output Ports

    97. What is RAM?

    98. What is a heat sink?

    99. A tera byte is equal to 1 trillion bytes. (True/False)

    100. What is a motherboard?

    101. Define the term ROM.

    102. What is PROM?

    103. Name the types of ROM.

    104. Name any four factors by which you can differentiate between primary memory and secondary memory.

    105. Name two types of RAM.

    106. Name the memory which is volatile in nature.

    107. Define buffer.

    108. What is print spooling?

    109. What is memory?

    110. Do you think internal processor memory is required? If yes, why?

    111. Expand the following :

    (i ) EPROM (i i ) EEPROM

    112. What is flash memory?

    113. What do you mean by input/output ports?

  • 7

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    114. What is the use of a power connector?

    115. What types of connectors are used in a modem?

    116. What is Bluetooth?

    117. How is the LPT port designed

    118. What is the use of SMPS?

    119. Who developed the PS/2 port? 120. Which port is connected to the mouse wire?

    121. What is the use of infrared port?

    122. Write the steps to connect a cable with infrared port. 123. Name the device which is connected to serial port.

    124. Name the devices which can be connected to USB port. 125. Why do we need an UPS with the computer system?

    ---------------------------------------------------------------------------------

    UNIT 2:PROGRAMMING METHODLOGY

    Chapter 1:-Programming Methodology and techniques

    126. What is a modular programming?

    127. What is robustness?

    128. Name three types of debugging errors. What types of error computer can detect?

    129. Give the characteristics of a good program?

    130. What is the portability of a program

    131. What do you understand by testing and debugging of program? 132. What is representational error? 133. How can you choose a variable in programming? 134. What is a problem definition? 135. Write the methods that are used to analyze a problem step-by-step. 136. What are relational operators? 137. What is a dry run? 138. What will be the minimum number of inputs for finding a simple interest? 139. What is the use of arithmetic operators? 140. What is iteration construct? 141. What is a logical operator? Give an example.

    Chapter 2:- Algorithm and Flowcharts

    142. Define algorithm? 143. Define flowchart? 144. What are the minimum requirements to draw a flowchart? 145. What is the purpose of a decision box in a flowchart?

    Short Type Questions (Type-II)[2/3 Marks] [SAQ-II] Unit-1-COMPUTER FUNDAMENTALS

    Chapter 1:-Evolution Of Computer:

    1. Expand CPU and the function of its parts. 2. Distinguish between primary memory and secondary memory.

    3. Define primary memory and enlist the parts of primary memory. Also, name them 4. Explain any two functions of ALU. 5. Expand the following : (i) ALU (ii) RAM (iii) GUI (iv) CD-ROM

    6. Give two major innovations in the second-generation computers.

  • 8

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    7. State five benefits of using a computer. 8. Define the terms input and output. 9. What are the functions of a computer ? 10. Explain the Pascal's Arithmetic Engine. 11. Describe the first-generation computers. 12. Describe the fourth-generation computers. 13. Give some characteristics of the first-generation computers. 14. Describe the functional units of the computer. 15. What are the functions of the control unit? 16. Distinguish between volatile memory and nonvolatile memory. 17. What are the limitations of a computer system? 18. Differentiate between cold booting and warm booting. 19. Classify the computers according to the sizes they offered. 20. What are the primary functions of the CPU ? 21. Differentiate between digital computers and analog computers. 22. Fill in the blanks.

    a) A printer that forms characters out of a set of dots is called b) There are two basic types of disks ..and

    23. Give the full form of following : (i) CPU (ii) LSI

    24. What is the use of memory? What are its measuring units?

    Chapter 2:-Computer Software

    25. What is the difference between a compiler and an interpreter? 26. Differentiate between system software and application software. Give examples of each type

    Of software.

    27. What is the difference between hardware and software? 28. Write the functions of the following :

    (i) Compiler (ii) Interpreter (iii) Assembler

    29. Define the following : (i) Source Program (ii) Object Program

    30. Ms. Vidya Sagar is confused between proprietary software and open source software. Mention at least two differences to help her understand the same.

    31. What are utility programs? Give examples.

    32. What is a text editor? Give two examples. 33. What is the difference between open source software and freeware software? Write two examples of each.

    Chapter 3:-Functions Of Operating System

    34. Explain the major functions of an operating system. 35. What is single user and multiuser operating system? Give an example of each. 36. Briefly, describe the term multitasking and time sharing. Give an example of each.

    37. Define operating system and its purpose. 38. Explain shortest-job-first (SJF) and round robin scheduling techniques.

    39. What are the operations performed by an operating system? 40. Give some reasons for studying the operating system. 41. What is swapping? Why is this technique useful in an operating system?

    42. Describe the basic memory management functions of an operating system. 43. Give the examples of preemptive scheduling.

    44. Define pages and blocks in paged memory management. 45. Write down the basic functions of an operating system as a device management. 46. What are the basic functions of an operating system?

  • 9

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    47. Name three categories of I/O devices. 48. What is the difference between preemptive and non-preemptive scheduling? 49. Give some examples of real time application areas.

    50. Differentiate between real time process and real time system. 51. What is the difference between multiprogramming and multiprocessing? 52. Write two advantages and disadvantages of partition allocation. 53. Write down two advantages and disadvantages of swapping. 54. Write down the basic functions of operating system as process management.

    Chapter 4:-Number System 55. Make a binary addition of 57 and 50.

    56. Convert the following into its equivalent : (i) (11011101)2 (?) 10 (ii) (10101000110)2 (?)8

    (iii) (10101000110)2 (?)16

    57. Convert (1100110)2 (? ) 16 ( ? ) 8 58. Find the l's and 2's complement of 64. 59. Determine the following :

    (i) (011001.001110)2 (ii) (2AC9)16= ( ? ) 2 (iii) (11011101.0111)2 (?) 10

    60. Convert the following :

    (i) (1100)2 (?)10 (A6)16( ? ), 61. Convert the following : (i) (11111011110101)2 to octal (ii) (11111011110101)2 to hexadecimal 62. Convert (B2F) 16 to Octal.

    63. What is the base of Decimal, Binary, Octal and Hexadecimal number system? 64. Convert (EB4A) 16 (?)8 65. Convert (101.10)16 ( )

    2 (?)10

    66. Convert (3674)8 (?) 2 ()10

    67. Convert (288)10 (?) 2 (?) 8 (?) 16 68. Convert (101010) (?)16(?)10 69. Convert following decimal numbers into its equivalent binary codes.

    (i) (50)10 (?)2 (ii) (0.375)10(?) 70. Determine the binary equivalent of the following decimal numbers :

    (i) 282 (ii) 462

    71. Convert the following binary numbers into decimal numbers :

    (i) 1101100 (ii) 11011101

    72. Convert (0.52),0 to its binary equivalent.

    73. Determine the octal equivalent of the following binary numbers : (i) 011001 (ii) 10101000110

    74. Determine the hexadecimal equivalent of the following binary numbers : (1) 101111100001 (ii) 10101111

    75. Convert the following octal numbers to their binary equivalent : (i) 36 (ii) 426

    76. Convert the following octal numbers to their decimal equivalent : (i) 36 (ii) 426

    77. Convert the following hexadecimal numbers to their decimal equivalent : (i) 9C (ii) 2BC2

    78. Find the l's and 2's complement of 42. 79. What do you understand by the computer codes? Name the computer characters which are widely

    used.

  • 10

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    80. Convert (0.752)10 to its binary equivalent.

    Chapter 5:-Microprocessor

    81. What is the function of arithmetic logic unit? 82. Define the following :

    (i) Data bus (ii) Address bus

    83. Define the following :

    (i) Program counters (ii) Accumulator

    84. What are the two units for measuring CPU clock speed ?

    85. What happens when a computer is turned on? 86. What are the functions of control unit? 87. In Microprocessor design, name any three registers and their purposes. 88. Why are registers essential for a computer CPU? 89. Why do you need a CISC processor? What is its goal? 90. Write down the major characteristics of RISC processor. 91. Write down the major characteristics of CISC processor. 92. Explain the role of different registers for data processing. 93. Distinguish between instruction set and instruction cycle. 94. Differentiate between register and bus. 95. Differentiate between CISC and RISC processors. 96. State two differences between address bus and data bus. 97. Differentiate between program counter and instruction register. 98. Briefly, explain the working of control unit in a microprocessor.

    Chapter 6:-Memory and Input/output Ports

    99. Define access time?

    100. Distinguish between RAM and ROM. 101. Expand the following :

    (i) SMPS- (ii) RISC (iii) RDRAM (iv) CISC

    102. Expand the following :

    (i) CVT (ii) RAM (iii) ROM (iv) FDD

    103. What is the purpose of cache memory? 104. Define the terms Seek time and Latency time.

    105. Differentiate between buffering and spooling.

    106. What are the different types of memories of a computer? Explain.

    107. What do you mean by EPROM and EEPROM?

    108. Differentiate between PROM and ROM.

    109. Differentiate between Static RAM and Dynamic RAM.

    110. Differentiate between Ll cache and L2 cache.

    111. What are the characteristics of a USB port?

    103. Name at least five infrared devices.

    104. Differentiate between parallel and serial port.

    105. What is the use of the USB port? Name few devices which are connected to the USB port. 106. Why is PS/2 port required in the computer? Name the devices which are connected to PS/2 port.

    ---------------------------------------------------------------------------------

  • 11

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    UNIT 2:PROGRAMMING METHODLOGY

    Chapter 1:-Programming Methodology

    107. What is the difference between run-time error and syntax error? Give an example of each. 108. Name the different types of program maintenance. 109. What is program maintenance? 110. What is modularity? What benefits does it offer? 111. What type of errors generally occurs while programming? Describe each in one line. 112. What is the purpose of comments and indentation in a program? 113. Write the different stages of program development process. 114. Explain the term "Analyze the Problem". 115. What is comment? Why do you need to write comment? 116. List the basic rules to write expressions. 117. What is the use of indentation in a program? 118. What is the importance of program documentation?

    119. Define the terms input, process and output. 120. What is decision structure? Give two examples. 121. Why independent inspection is more important than Dry Run? 122. Write the different control structures that are used in problem solving techniques.

    Chapter 2:-Programming Methodology and techniques

    123. What will be the output of the following?

    Print ("Introduction to Python \programming")

    Print ("100+200")

    Print (100%10)

    Print (100//11)

    124. State the basic rules to declare variables in Python.

    125. What do you mean by the following statement? Print ("Gold is: 25000"); print ("10 to the power 2

    is: 10**2)

    126. What is an integer?

    127. Write Python statements for the following:

    Assign the value of the variable number] to the variable total.

    Assign the sum of the two variables loop count and petrol _cost to the variable sum.

    Divide the variable total by the value 10 and leave the result in the variable discount.

    Assign the character W to the char variable letter.

    Assign the result of dividing the integer variable sum by 3 into a variable costing.

    128. Write Python statements for the following :

    To print the value of the integer variable sum.

    To print the character variable letter.

    To read a float variable into the variable discount rate.

    129. Which of the following are invalid names and why?

    (i) Paidlnterest (ii) s-num (iii) percent (iv) 123

    (v) dit, km (vi) class (vii) while (viii) Roll. No (ix) int

    130. Some of the following Python values are written incorrectly. Identify the error(s) and give correct

    form. (i) 5,34 (ii) +345 (iii) 0.57- (iv) 8.34E4

    131. Following variables are written incorrectly. Identify the error(s) and correct them. (i) 2Emp

    (ii) EMP- (iii) Stud name (iv) A$ (v) (roll) (vi) S-Name

    132. Write the value stored in the variable Num by each of the following statements :

  • 12

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    (i) Num= 2*3-4 (ii) Num = 2+3-1*3 (iii) Num = (2+3)*2 (iv) Num = 3* *4+5 133. What value will be stored in different variables when the following Python statements are

    executed?

    i =10

    j = i+5

    k= i+j/5

    1=k+1

    m=1+ 1i n=k+m*1

    Print

    Print ("i = %d, j = %d, k = %.2f, I = %.2f, m = %.2f' % (i, j, k, 1, m) 134. Correct the error(s), if any, in the following statement :

    (i) 3* 5 = x (ii) l*b = area (iii)1= ab + c*d (iv) A = P * R * N/100

    135. Write the statements for the each situation as given below :

    (i) Assign a value 2 to variable A.

    (ii)Assign the value of variable N to variable N1.

    (iii) Print the string "February" on the screen.

    (iv) Assign the value represented by the formula A2+B2+C to variable X.

    136. Write the Python expressions for the each situation as described below :

    (i) Increase the value of variable count by 2.

    (ii)Assign the value 3 to variable Cl, C2, C3.

    (iii) Assign 20, 30, 40, and 40 to variables V1, V2, V3 and V4 respectively.

    (iv) Print the statement "Hello! World" in the following format: Hello! World.

    137. Write the Python expressions for the each situation as described below : (i) Assign a Boolean value False to Flag.

    (ii)Double the value assigned to variable C.

    138. In each of the following cases, show how comment can be placed in the Python program. (i) Add the program heading Sum of the odd and even numbers. (ii)Add the comment average value to the statement : x = sum/n

    139 Evaluate the following Python expressions when values of a, b, d = 5, 3, 1.5 (1) C = a - (++b) *(--d) (ii) f = (++b)*b - a

    (iii) C=d*a+b ( iv) f=a+b/a

    (v) C = (++a) * d + a 140. Write an example of each part?

    I. Literals II. Fundamental data types

    III. Python file extension

    Long Type Questions [3/4 Marks] UNIT 2:PROGRAMMING METHODOLOGY

    Chapter 2:-Algorithm and Flowcharts 1. Write an algorithm for finding the simple interest. 2. Write an algorithm for calculating the conversion from rupees to dollars. 3. Write an algorithm to compute factorial of a given number. 4. Write an algorithm to find out whether the given number is divisible by 3 or not ? 5. Write an algorithm to find out the square of 'N' prime numbers. 6. Write an algorithm to print the Fibonacci series (0 1 1 2 3 5 8 .... up to 'N' terms). 7. Write an algorithm to find the sum of two numbers.

  • 13

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    8. What is the role of flowchart in high-level programming? 9. Mention the characteristics of an algorithm. 10. Draw a flowchart to find the sum of two numbers. 11. Draw a flowchart to accept a number and print the cube of that number. 12. Write an algorithm to find the greatest of the three given numbers.

    13. Write an algorithm and flowchart to compute the sum, average and product of any of three numbers of your choice.

    14. Write an algorithm that prints the greatest number of two given unique numbers.

    15. Write an algorithm that can read 20 integer values and print the total.

    16. Draw a flowchart to find whether a number is even or odd. 17. Draw a flowchart to read two numbers and display the numbers in the decreasing order.

    18. Draw a flowchart to find the greatest number of the given two unique numbers.

    19. Draw a flowchart to find the greatest number of any three numbers A, B, and C. 20. Write an algorithm to find whether a given number is odd or even.

    21. Draw a flowchart to find the sum of first 10 natural numbers.

    22. Write an algorithm which will calculate the sum of first 'N' multiples of an integer 'Ni' i .e. . , 1 x N1 + 2 x N1 + +N x NL.

    23. Write an algorithm to print total number of negative (-) and positive (+) numbers and zeroes (0). 24. Write an algorithm to read a set of 20 numbers and make a sum of all non-negative numbers in this set of

    numbers.

    25. Draw a flowchart for computing factorial 'N' (N!) Where N! = 1 x2 x 3 x x N.

    26. Write an algorithm to calculate the sum of 'N' odd and even numbers. 27. Write an algorithm to compute the sum of the squares of 'N' numbers. 28. Draw a flowchart to compute the sum of the squares of 'N' numbers.

    29. Write an algorithm to input 'N' numbers and find the greatest number among them.

    30. Draw a flowchart to find the sum of the series :1' + 2' + 3' + + N' - - - - (N (N + 1)] 31. Develop an algorithm (step-by-step solution) for a selected integer between 0 and 100. Let this number

    be the marks scored by a student in a particular test. Convert this integer (number) into letter grades (A, B, C, D, E) as given in the table below:

    32. Draw a flowchart to check whether number 'N' is prime or not.

    33. Write an algorithm to find the greatest common divisor between two numbers x and y. 34. Draw a flowchart to check whether number 'N' is an Armstrong number or not.

    --------------------------------------X------------------------------------

    Numerical Condition Letter Grade

    < 40 E

    >=40 and = 55 and = 70 and 85 A

  • 14

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    MODULE-B

    The following chapters are in portion of Final Term Examination.

    UNIT 3:INTRODUCTION TO PYTHON Chapter 1:-Overview of Python

    Chapter 2:-Input/output in Python

    Chapter 3:-Operator and Expression In Python

    Chapter 4:-Working with Math Module

    Chapter 5:-Branching and Looping in Python

    Chapter 6:-User-Defined Function in Python UNIT 4:PROGRAMMING WITH PYTHON Chapter 1:-Working with Strings and Lists Chapter 2:-Working with Directories and Tuples

    Unit-3-INTRODUCTION TO PYTHON Chapter 1:-Overview of Python:

    Short Type Questions [1/2 Marks] [VSAQ/SAQ-I] 1. How can we declare variables in Python? 2. What is dynamic type? Give example. 3. What is IDLE? 4. What is script? Where can you write the Python Code? 5. Why a banner saying "RESTART" is always displayed in Python program execution? 6. What is a keyword? 7. Name the key attributes of a Python object, 8. How can you define the string literals in Python? 9. Explain the following command: Print ("Hello World.") 17. When we write a statement like a, b, c,d=1, 2, 3, 4 What does you call it? 18. Name five standard data types in Python. 18. Differentiate between single quotes, double quotes and triple quotes 19. How can you create a complex literal in Python? 21. Name two sequence types and set types in Python. 22. How can you create an empty list in Python? 23. Is string a sequence type data type? 24. How can you create an empty tuple in Python? 25. What is the use of Del statement?

    26. What is Python? 27. Who created Python?

    28. Why is Python an interpreted language?

    29. Why is Python an interactive language?

    30. What is Python shell?

    31. Why is Python an object-oriented language? 32. What does a variable hold in Python? 33. How can we declare variables in Python? 34. What is IDLE? 35. What is script? Where can you write the Python code? 36. Why a banner saying "RESTART" is always displayed in Python program execution? 37. Name five major platforms where Python is available. 38. Why is it necessary to set Python in system's environment variable? 39. What do you get after starting the Python in IDLE mode (Python GUI)?

  • 15

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    40. What will be the Python statement to print a message like "Welcome to Python? 41. What are keywords? 42. What are the console I/O functions? 43. What do you mean by an identifier? 44. What is a variable? 45. What is scalar variable? 46. A literal is a sequence of characters surrounded by double quotes. 47. Name the Python operator which is responsible to declare variables. 48. How are comments written in a program? 49. What is indentation of a program? 50. What do you understand by the character set of a language? 51. What are the various components of Python character set? 52. What do you mean by a token? 53. Name any four tokens of Python. 54. List the three types of numbers supported by Python. 55. What are floating-point numbers? 56. What are character/string constants? 57. What are floating point constants? 58. In a statement like "print (" {0} {1} {2} "format (vall [0], val2 [1], val2 [2]))", what is 0, I and 2? 59. What are escape sequences? 60. Which escape sequences represent the newline character and tab? 61. What is the extension of a Python script program? 62. What is an operator? 63. What is an operand? 64. What is an arithmetic operator? 65. List different arithmetic operators. 66. How '/' operator is different from "/o' operator? 67. What is a unary operator? 68. What is a binary operator? 69. What are relational operators?

    70. List different relational operators. 71. If p = 9.8, what will be the result of int (p/9)? 72. What are logical operators? 73. List different logical operators. 74. What is a statement? 75. Which operators are used to combine relational expressions? 76. Which types of operators are used to compare the values of operands? 77. What happens if one of the operands of a logical and operator is false? 78. What happens if one of the operands of a logical or operator is false?

    79. What is an assignment operator? 80. What is compound assignment?

    81. What is modulus operator (%)?

    82. The modulus operator works only with integers true or false. 83. The operator is same as the assignment operator (=) True or False.

    84. What is the difference between `=' and operators?

    85. What is the purpose of comma operator (,)?

    86. What is an expression?

    87. Name the two functions which are helpful to convert string input into number format.

  • 16

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    88. Name some common syntax error messages displayed by Python.

    89. Write a statement to print "Harish" five times.

    90. What will be the output of the following statement print (3 - 10**2 + 99/11) Chapter 2:-Input/output in Python

    91. If you type the following code in interactive mode, what it wM print and W h y ? print ("Python", "Programming.")

    92. Where do you place the keyword parameters like end and Sep? 93. What does the default value print by Sep argument with print () function? 94. What does the default value print by end argument with print () function? 95. What is the use of % operator with print () function? 96. What is the purpose of the following statement?

    TMark = int (irrupt ("Enter your total mark :"))

    97. What does an input () function return? 98. What will happen if you do not use prompt with input () function? 99. What is the output of the following:

    (a) print ("My percentage is: %.2F" 89.9625)

    (b) print ("My percentage is: %d" % 89.9625) 100. What is print function? 101. What is the input function? 102. Differentiate between input () and rawinputO function?

    Chapter 3:-Operator and Expression In Python

    103. How do we convert a string to a number in Python?

    104. What will the code produce? Print (type (112))

    105. Can we do ++x and x++ in Python?

    106. If you write the following statements? What will be the output of the following program

    segments?

    (a) A = 5 (b) a, b=1, 2, 4 (c)a,b=0,30;

    A= 25 + 4 -4 a+=4; a=30/b*b; Print (A) print (int (a/2)) print (a);

    107. What will be the output of the (a) x = 5 ( b)a = 25 + 4 - 4 Print (++x) print (a)

    108. What will be the output of the following code? (a) a = p. (b) a=1;

    a, b = a+1, a+1 b=1; Print (a) a, b = b, a Print (b) print ("%d %d" % (a , b) )

    109. What ail options will work? Write the comments for the following expressions.

    (a) n= 1 (b) n = 1 (c) n = 1

    Print (n++) Print ++n print (n += 1)

    (d) n = 1 (e) n

    Print (n = n+1) n=n+1;

    Print (n)

    Chapter 4:-Working with Math Module 110. What are modules? 111. What is dot (.) notation in python? 112. How do you get a random number between 1 and 100 using random() function ? 113. Write the equivalent Python expression(s) for the following : x = Va2 + b2 + c2

  • 17

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    V| (b2 4ac)

    Assume that a = 2, b = 3, c = 2. 114. Write the Python expression(s) for the following : a = ex x Assume that x = 2. 115. Write the equivalent Python expression(s) for the following : b=(R+S) Assume that R = 2 and S = 4.

    116. Write the equivalent Python expression(s) for the following :c = 2 4y * (P + Q)2 Assume that y = 2, P = 4 and Q = 3

    117. Write the equivalent Python expression(s) for the following: d = A + B + eY Assume that A = -4, B = 4 and y = 5.

    118. Write the equivalent Python expression(s) for the following e = (A + + (C + D)4 Assume that A = 3,

    B= 2, C = 5 and D = 5.

    119. Write the equivalent Python expression(s) for the following : root 1 = (b) +

    /2a NOTE - Assume that a = 3, b = 4 and c = 2.

    120. Write the equivalent Python expression(s) for the following :

    z = x' + y3 v|xy/2 Assume that x = 3 and y = 4.

    121. Why is the following statement not executed? math.cos (math.pi / 4)

    122. What will be the output of the following lines ? (i) Import random

    Random. Choice (['White line', 'Green line', 'Blue line'])

    (ii) Import random

    random.randrange (6)

    123. Translate the following mathematical expression into an equivalent Python expression(s). Assume that the math library has been imported.

    x = /r (cos a) 2 + r (sin a)

    Chapter 5:-Branching and Looping in Python

    124. What is a sequence construct? IL What is a selection construct? 125. What is branching? 126. Give two examples of control structure. 127. What is iteration construct? 128. What is the body of the loop? 129. What is Boolean value? 130. What is an exit condition? 131. What is an alternative name of exit condition? 132. What is conditional statement? 133. What is a while loop ? 134. What is the name of the construct used in the following statement and how does it operate?

    x = a if (a>b) else b

    135. What the use of continue statement? 136. What is the purpose of a for loop?

    137. What is pass statement? Chapter 6:-User-Defined Function in Python

    138. What is a user-defined function?

    139. Name the keyword that indicates the function definition. 140. What are parameters?

    141. What is fruitful function?

    142. What is void function? 143. Define flow of execution. 144. What is a global variable?

    145. What are the roles of the arguments in a function ? 146. How will you call a function that contains arguments?

  • 18

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    147. Define scope of variables. 148. How many values can be returned by a function? 149. How many times can we call a function?

    150. What are function arguments? 151. What are default arguments? 152. Identify the default arguments from the following function :

    Def func(a, b, c=10, d=100):

    Chapter 1:-Working with Strings and Lists

    153. What is string ? 154. How can you create string literals?

    155. Name the function which counts the number of characters in a string. 156. How can you create an empty string ? 157. Define the term whitespace.

    158. A string called str contains whitespaces at the left of the string as given,

    str = " Python Program"Write the command to delete the spaces.

    159. What type of result is produced when we compare two string with `=='operator ? 160. Explain the string method swapcase(). 161. Define l ist .

    162. What will be the output of bval if two strings strl and str2 contains "Delhi" and "New Delhi

    (i) bval = strl > str2 (ii) bval = strl .lower() < str2 163. What is an empty list ? 164. Can you sort a list which contains both numeric and string data.

    165. What will be the output of the following code ? nums = [1, 2, 3, 4]

    sqrt = [n * n for n in nums] print (sqrt)

    166. Write a statement to convert the following string into a list.

    str = "Fundamental of Python"

    167. Write the output of the following program code.

    str = 'virus-virus-virus'

    dl= - print (str.split(d1))

    str = 1"Fundamental" , "of', "Python"1

    dl = "" # no space

    print(dl.join(str))

    Working With Dictionaries and tuples 168. What are dictionaries?

    169. What is the importance of key in a dictionary? 170. How can you create a dictionary in a Python? Give an example.

    171. What is the use of update () method in a dictionary?

    172. State two differences between dictionaries and lists.

    173. A dictionary contains the following data : Student = 5:"Astha Anand", 7:"Shivangi Singhal", 11:"Kaavya Ashok Pillai",

    9:"Tamanna Banal", 4:"Sanya Bhatia", 3:"Tina Khorana"}

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

    Print ("There are %d students in dictionary." % len(student)) 175. Define keys(), values() and items() methods.

  • 19

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    176. What will be the output of the following code ?Metro = {1:"Delhi", 2:"Mumbai", 3:"Chennai",}

    177. Is tuple object support item assignment?

    178. State two differences between tuple and list.

    Short Type Questions (Type-II)[2/3 Marks] [SAQ-II]

    UNIT 3:INTRODUCTION TO PYTHON Chapter 1:-Overview of Python

    1. How can you exit from Python shell window?

    2. Write the general rules to name Python file.

    3. What is token? Name the Python tokens.

    4. How do you write comments in Python programming?

    5. Why Python is called as a calculator?

    6. Name the function which tells the data type of an object.

    7. What is data type?

    8. Does Python support a data type declaration like C, C++ and Java language? How is a data type created in

    Python?

    9. Name the basic and sequence data types in Python.

    10. Write a statement to assign a numeric value 100 into a variable Varl. What is the use del statement?

    11. Is Python long data type? If no, how a long value behave in Python? What is string? Assign a string "CBSE School"

    into a variable STR. What is the basic rule to declare a string?

    12. On declaration point of view, mention the special characters which are used to declare string, list, tuple and

    dictionary values.

    13. Differentiate between list and tuple data type.

    Chapter 2:-Input/output in Python

    14. What type of value is accepted by input() function in Python 2.x? 15. What type of data is accepted by input() function?

    16. Write the keyword arguments of print() function. 17. Why a numeric conversion is required in input() function in Python 3.x? 18. Can you convert floating-point number using input() function? Give an example. 19. What is colon separator? Where can you use it? 20. In Python format function, what does it mean: {1:8.2f}? 21. Find the output of the following:

    Van 1 = 10.542345667 Format (Val, '.5f) Format (Val, '.2f)

    22. Correct the following code: User name = input (" Enter your name: )"

    23. Correct the following code: Value = int (input (print (" Enter your age ")))

    Chapter 3:-Operator and Expression In Python

    24. What is operator? 25. What is arithmetic operator?

    26. What is the difference between / and % operator? 27. What is relational operator? Give two relational expressions.

  • 20

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    28. What is logical operator?

    29. What is unary operator? List some unary operator. 30. What is the purpose of assignment operator? How is it different from cin statement? 31. Give an example of a Python expression. 32. What is an operator in Python? 33. What is the purpose of type conversion? 34. What is simple assignment and compound assignment? 35. The modulus operator works only with integerstrue or false. 36. Determine the error in the following statements:

    a) Print ("hello ");

    b) a=2, b=5, c= 11; d=21

    Chapter 4:-Working with Math Module

    37. Why does the following not execute at interactive mode? diel = random.randrange(6) + 1

    38. Write the equivalent Python expression(s) for z = cos x +V a2 + and b = 4.

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

    z = 9.97

    Print (math. Ceil (z))

    Print (math. Floor (z))

    40. Write the equivalent Python expression(s) for the following:

    1. Distance = ut + at2 2. Velocity = u2+2as

    Assume that u=2, t=3, a=5, and s =3;

    41. Write the equivalent Python expression(s) for the following:

    Area = r2 + 2rh [ Assume that r = 6 and h = 4].

    42. Write the equivalent Python expression(s) Side = \/a2 + b2 - 2ab cos(a) Assume that a = 4 and b = 5.

    43. Write the equivalent Python expression(s)

    Exp = 2(a2+ b

    2)/a-b [Assume that a = 3 b= 4]

    Chapter 5:-Branching and Looping in Python

    44. Why is it necessary to use whitespace at the beginning of program lines?

    45. Which abbreviated statements are used to replace if..... Else statements? Give two examples.

    46. Define looping. Write two looping statements that are used in Python.

    47. What will happen when a single alternative selection structure executes ?

    48. What is the difference between selection and repetition ? [CBSE Book]

    49. What is statement 2 called as ? After executing the all the given statements, what will be the value

    of y ?

    y = 1 # Statement 1

    x = 3 if (y == 1) else 2 if (y == -1) else 1 # Statement 2

    print (y) # Statement 3

    50. Write the statements for the following situations:

    x is greater than or equal to y.

    x is not equal to y.

    \x is equal to y.

    x is less than y and x is less than z.

    Either x is greater than y or x is less than z.

  • 21

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    If x has a value greater than 20 then increment the value of the k by I otherwise decrement the

    value by 2.

    51. Write an appropriate for or while loop for the following situations :

    52. (1) A loop is to be repeated 200 times.

    53. (ii) A loop is to be repeated 200 times, but the loop is to be terminated if the value of the variable X

    becomes 175.

    54. What output will the following code fragment produce ?

    n = 1000

    Val = int (input ("Enter a value: "))

    Res = 400 if (n + Val > 1750) else 200

    Print (res)

    If the input is 2000

    If the input is 1000

    If the input is 500

    55. Use of an if statement to compare the value of an integer called sum against the value 65 and if it is

    less, print the text string "Sorry, try again".

    56. Write a for loop to print the values from 1 to 10 in separate lines.

    57. Write a for loop which calculates the sums of all values between 0 and 100 into a variable called

    total.

    58. Write a for loop to print the character from A-Z in a single line with one space like A, B, D, Z.

    59. If variable total is equal to the variable good guess, print the value of total, otherwise print the value

    of good guess using if statement.

    60. What is abbreviated operator? What will be the output of z in the following expression:

    z = 150 if (y x > 500) else 50 If the input is:

    (i) x, y = 300, 700

    (ii)x, y = 700, 800

    61. Write Python statement for the following :

    If variable sum is equal to 10 and total is less than 20, print the text string "Incorrect" using if statement.

    62. Write Python statement for the following :

    If flag is 1 or letter is not an X, then assign the value 0 to exit _flag, otherwise set exit flag to 1

    63. Write the output of the following program :

    a, b = 6, 4

    for i in range(0, a+1):

    print("%d" %(i), end =" ")

    for j in range(0, a+1):

    b=a

    a=a+1

    b=b+1

    print ("%d" %a)

    64. Write the equivalent while loop for the following for loop : n = 20

    For i in [1, 10]:

    n + = i

    65. Translate the following for loop into a while loop : for i in range(l, 10, 2): Print ("i =", i)

  • 22

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

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

    j, i = 1, 2

    while (i< 5):

    j=i *

    i= i + 1

    print("j is: %d" %j)

    67. What values will be assigned to the variables ua, ub , uc and fail after execution of the following program

    segment ?

    i = ua = ub = uc = fail = 0

    while (i

  • 23

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    72. Write a program that prints 1 2 4 8 16 32 64 128. 73. Find the error(s), if any in the following program: const MAX = 4

    a = int(("Enter the value of a: "))

    b = int(input("Enter the value of b: ")) if (a > b):

    MAX=5 for in range(0, MAX):

    print ("%d" %(x))

    74. Find the error(s), if any in the following program:

    sum = value = inct = 0 for i in range(0, 11)

    value = int(("Enter value :")) sum = sum + value

    inct = inct + 1 avg=sum\inct

    print("The average is %d" %(avg))

    75. Find the syntax error(s), if any, in the following program : W == 90

    R while (W > 60)

    R = W 50 if (R = 20):

    print("Lower Range") elif (R == 30):

    print("Middle Range") elif (R == 40):

    print("Higher Range") = W 1 76. Find the syntax error(s), if any, in the following program :

    X = int(("Enter value of X :"))

    for in range(0, 11):

    if (X Y):

    print("%" %(X+Y))

    else:

    print("%d" % Y)

    77. Find the syntax error(s), if any, in the following program : x = int(("Enter value of x :"))

    for y in range(1, 6)

    print("" %y)

    print("%d %d" %(x,y))

    78. Give the output of the following program segment : a, b, c = 300, 0, 0 if (a >= 400):

    b = 300

    print("%d %d %d" %(a,b,c))

    79. Rewrite the following set of if-else statements in if. Else if statements. num = int(input("Enter the number : "))

    if (num = = 5):

    val = num * 25 - 20

    print("%d" %(num + val))

    else:

    if (num = =10):

    val = num * 20 - 15

    print("%d" %(val - num))

  • 24

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    80. Give the output of the following program segment : for i in range(1, 6):

    for j in range(1, i+1):

    print(" ", end=")

    print()

    for j in (6, 1, -1):

    for j in range(1, i+1):

    print("*", end=")

    81. Find the output of the following code :

    (i) b = 5

    b = b + 1

    if (b = = 5):

    print("Value is five")

    else:

    print("Value is not five")

    (ii) i = 1

    While (i < 5):

    Print ("%d" %(i), end=")

    i = i * 2

    82. Write the output of following segment : x-0

    for i in range(0, 5): for j

    in range(0, i):

    x=x+(i+j - 1)

    print("%d" %x, end="")

    print()

    print("%d" %x)

    83. What will be the output of following segment ? x = 0

    for i in range(0, 5):

    for j in range(0, i):

    k=i+j - 1

    if (k % 2 = = 0):

    x = x + k

    elif (k % 3 == 0):

    x x + k - 2

    pritit("%d" %x, end="")

    print("%d" %x, end="")

    84. What will be the output of following program segment ? for i in range(0, 10):

    if (i == 5):

    break

    print("%d" %i, end=" ")

    85. In the following if...else statements, which statement will be executed next if the value of a=5 and b=10.

    (i) if (a * a >= b):

    a = a + 1

    else:

  • 25

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    b = b + 1

    (ii) if ((a > 4) or (b < 7)): (iii) if ((a * a) < b): print("Greater") print("%d" %(a*a))

    else: else: print("lesser") print("%d" %(h*b))

    86. Will the following program execute successfully ? If not, state the reason(s).

    sl = s2 = 0 for x in range(0, 11):

    num = int(("Enter The number : "))

    (num > 0)

    sl =s1 + num else:

    s2 = s2 / num print("%d %d" %(sl, s2))

    87. Write the output of the following statements :

    (i) for I in range(1,10): if(I = = 4):

    print("I= %d" %(I))

    (ii) for I in range(1, 4): for j in range(1, 5):

    print("%d" %(I+j))

    88. Write the output of the following program :

    vl, v2 = 5, 10

    for x in range(1, 3):

    vl = v1 + 1

    v2 = v2 1 print("%d %d" %((v I), (v2)))

    print("%d %d" %(v2-1, v1+1))

    89. Find the output of the following program :

    Number = 7583241 First = Second = 0 while (Number > 0): R =

    Number % 10 if (R % 2 != 0):

    First += R

    else:

    Second += R Number = Number // 10

    print("%d" %(First Second))

    90. Give the output for the following program segments :

    (i) for i in range(10, 6, -2): Print ("%d" % i)

    (ii) for i in range(-5, -8): Print ("%d" % (i+1))

    Chapter 6:-User-Defined Function in Python 91. What are the advantages of user-defined functions ? 2.. Differentiate between local and global

    variable.

    92. What is the significance of an empty parentheses in a function declaration ? -L Explain the

    types of functions.

  • 26

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    93. Give the output of the following program : def valFunction():

    vat= 10 pass

    print(valFunction())

    94. Write the first line of the function definition for each of the following :

    (i) A function area accepts two variables a and b. (ii) A function Display which does not accept any variable. (iii) A function series with variable-length parameters.

    95. Differentiate between formal and actual variables. 96. A function printchar is defined as : def printchar( ch = '@', len = 5):

    Write the calling function for the following outputs :

    (i) to print40 times (ii) to print `-' 20 times

    (ii) to print `=.' 40 times (iv) to print '' 30 times

    96. Write the output of the following program :

    def Execute(B, C = 100):

    TEMP = B + C B += TEMP if (C != 200):

    print("%d %d %d" %(TEMP, B ,C))

    M = 90 N = 10 Execute(M)

    print("%d %d" %(M, N)) Execute(M, N)

    print("%d %d" %(M, N))

    97. Give the output of the following program :

    ` def sumfn(last):

    sum = 0 sum2 = 0 for i in range(last, 0, -1):

    sum = sum + i

    sum2 = sum2 + sum print("%d %d" %(sum, sum2))

    for i in range(l, 5):

    sumfn(i)

    98. Give the output of the following program :

    'clef sum():

    calc()

    def calc():

    x = int(13.5)

    y = float(24.6)

    s = x + y

    print("%d" %s)

    sum()

    99. Give the output of the following program :

    def add(j):

    if (j >= 4):

    i=i

    else:

  • 27

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    j = j * 2 return j

    i = 4 a = add(i)

    print("%d" %a)

    100. Give the output of the following program : def fl (b):

    x = b * b

    return x

    for i in range(1, 6): a = fl (i) print("%d" %a, end=" ")

    101. Give the output of the following program : def square(i, j):

    i = i * j

    return i, j

    i = 4

    j = 10

    s, r = square(i, j) print("%d %d" % (s, r))

    print("%d" % i)

    print("%d" % j)

    102. Find the error(s), if any in the following program : sub(ml, m2):

    return(ml - m2)

    al = int(input("Enter the number n 1: "))

    n2 = int(("Enter the number n2 : "))

    result = sub(n1) print("%d" % result)

    103. Write the output of the following program :

    i = 100

    Def abc ():

    i = 8

    print ("first = %d" %i)

    Def main ( ):

    i = 2

    abc ()

    print("Second = %d" %i)

    main()

    104. Write the output of the following program :

    a = 3

    Def demo(x, y, z):

    a = 3

    a = a + (x + y)

    z = a + y

    y = y + x

    Print ("%d %d %d" %(a, z, y))

    a = 2

    b = 5

    Demo (a, a, b)

  • 28

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    Print ("%d %d %d" %(a, a, b))

    -------------------------------------------------------------------------------------------------------------------------------------------

    UNIT 4:PROGRAMMING WITH PYTHON Chapter 1:-Working with Strings and Lists:

    105. Differentiate between mutable data value and immutable data value. 106. What is a negative index in Python ? 107. Write Python statements for the following :

    (1) Assign x as convert string of digits "12345.70" to float type. (ii) Assign y as convert integer type to string : ival = 100

    108. Consider the following statement and answer the (i) and (ii) parts. String = ("Hello", "Python", "Programmer")

    (1) What is "len(String)" ?

    (ii) What is "list(String)" ? 109. Differentiate between upper() and isupper() functions.

    110. What will be the output of following program code ? str = "MyPython Programming"

    ctr = len(str)

    print (str[0:5])

    print (str[l :5])

    print (str[:-4])

    print (str[0:161)

    print (str[:20-4])

    111. What will be the output of following program code ? List = ["MyPython", "Programming", "in", "Python"]

    ctr = len(List)

    print (List[0:2])

    print (List[1:2])

    print (List[:-2])

    print (List[:1])

    print (List[:0])

    112. What will be the output of the following program segments ?

    (i) listl = [1,2,3,4]

    list2 = [3,4,5,6]

    list3 = listl + list2 print (list3) listl.extend(list2)

    print (listl)

    (ii) number = [20, 30, 40, 10, 50, 60, 90, 80, 70]

    number = number. sort()

    print (number)

    (ii) list = ["Mon", 45, "Tue", 43, "Wed", 42] print (list[ 1 :-1]) list[0:2] = 'Z'

    print (list)

    113. If a list M contains the following values :

    [5, 112, 203, 124]

    [10, 114, 27, 18] [11, 1 1 0 , 2 1 , a n d 1 1 2 ] what will be the output of the following statements? (i) print (M[-2][1])

    (ii) print (M[2][1])

    (iii) print (M[2][-1]) ( iv) print (M[2][-1])

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

  • 29

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    def test_me(a):

    a[0] = 'New value'

    a[1] = a[1] + 1 args = ['Old value',99] test_me(args)

    print (args[0], args[1])

    115. Write the appropriate for statements for the following:

    Subscripted variable Values of subscripted variable

    (i) I 1, 4, 7, 10

    (ii) A 1, 3, 5, 7

    (iii) X 1 5, 4, 3, 2, 1

    (iv) S 2, 4, 6, 8, 10

    Note :for loop expresions will change the values as given in second column in the above table.

    116. Find out the syntactical errors in the following program :

    Ch, Sch = 9, 90

    if Ch

  • 30

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    print()

    string_func("DELHI")

    121. What will be the output of the following program ? a = [1, 2, 3, 4. 5] for i in range(0, 5):

    a[i] = 5 * i

    for i in range(0, 5):

    print(a[i])

    122. What will be the output of the following program ? b, c = 0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]

    for a in range(0, 10):

    if (a % 2 == 0):

    b += c[a]

    print(b, end=" ")

    123. What will be the output of the following program ?

    b, c = 0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]

    for a in range(0, 10):

    b += c[a]

    print(b, end=" ")

    124. Identify error(s), if any, in the following program : sum[2, 4]

    for i in range(0, 2)

    for j in range(0, 3):

    print("%d" %sum)

    125. Identify error(s), if any, in the following program :

    a = [0, 1, 8, 7, 6, 4]

    for i in range(0,15):

    print(a[i])

    126. What will be the output of the following program segment ?

    str = "aNDarIeL", .

    nstr =

    for i in range(len(str)):

    if str[i].isupper():

    nstr = nstr + str[i].lower()

    else:

    nstr = nstr + str[i].upper(),

    print (nstr)

    127. Identify error(s), if any, in the following program : sum = [6, 3]

    sum = [1, 1] ()

    print(sum)

    128. What will be the output of the following program ?

    b = [4, 6, 7, 4, 5, 12, 11, 10, 8, 17]

    for I in range(1, 3):

    for j in range(1 , 3):

    b[I] = 4 * 1+ j

    print(b[I])

    129. Identify error(s), if any, in the following program :

    MAX = '5'

    list = (50, 40, 30, 20, 10)

  • 31

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    for Ctr in range(0, MAX)

    print(list[Cti]

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

    def test_me(a, b):

    a = 'New value'

    b = b + 1

    return a, b

    x, y = 'Old value', 99 x, y = test_me(x, y) print (x, y)

    Long Type Questions [3/4 Marks] UNIT 3: INTRODUCTION TO PYTHON

    Chapter 3:- Operator and Expression In Python 1. Write a program to input total number or days and find to l number of months and remaining days after

    months,

    2. Write a program to calculate the volume and area of sphere. (Volume (4/3) * pie " and Area 4 *

    r2

    3. Write a program that gets 2 string variables and 2 number variables from the user, concatenates (joins them together with no spaces) and displays the strings, then multiplies the two numbers MI a new line.

    4. What is the purpose of type conversion? 5. What is simple assignment and compound assignment? 6. The modulus operator works only with integersTrue or False. 7. Determine the error in the following statements: (a) print ("hello ");

    (b) a=2,b=5,c= 11; d=21

    8. Write a program to read numl and num2 and store their sum in num3 and product in num4. 9. Write a program to find the maximum of two numbers using conditional operator. 10. Write a program to enter the time in minutes and print in the following format:

    __________ Hours ________ min 11. Write a program to form the area of a circle. 12. Write a program to calculate

    (a) energy = m * g * h (b) distance = u *t + 1/2 * a* t2 (c) speed = distance / time

    13. Write a program to find the area of a square.

    14. Write a program to find the perimeter of a rectangle.

    15. Write a Python program that inputs a student's marks obtained out of 600 and print the percentage of

    marks.

    16. Write a program to find the sum of two given numbers. 17. Write a program to find the sum, difference, multiplication and division between two nu 18. Write a program to find the simple interest of certain principal. The formula is : SI = (Principal *Rate *

    Time) / 100

    SI = Simple interest

    Principal = Amount for which simple interest will be calculated

  • 32

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    Rate = Rate of interest

    Time = Time period for which interest will be calculated 19. Write a program to find the area and perimeter of a rectangle.

    20. Write a program to find the area and circumference of a circle. The formula is: Area of circle = r2

    Circumference of circle = 2r

    21. Write a program to find the surface area of a cube. (Note: The surface area of a cube is area of the six squares

    that cover it. The area of one of them is a x a, or a2.)

    22. Write a program to find the surface area of a rectangular prism. The formula prism is 2ab + 2bc + 2ac.

    Where a, b and c are the lengths of the 3 sides. 23. Write a program to find the surface area of a sphere. The formula is :

    Surface area of a sphere = 4r2 . Where r is the radius. 24. Write a program to find the surface area of a cylinder. The formula is: Surface area of a cylinder = 2r +2

    rh. Where h is the height of the cylinder, r is the radius of the top. 25. Write a program to find the square and cube of a given number.

    26. Write a program to take input for five subjects marks like English, Physics, Chemistry Mathematics and Computer. Find the total and percentage of the marks. Assume 10 maximum marks of each subject.

    27. Write a program to convert the temperature from Fahrenheit to degree Celsius. The formula Celsius = (5 * (Fahrenheit - 32)) / 9

    28. Write a program to find the sum of a given five digit number. 29. Write a program to print the values of two integers before and after swapping. 30. Write a Program to print the area of different shapes such as cube,rectangle,square and triangle based

    On value entered by user?

    Chapter 4:-Working with Math Module:

    31. Write a program to calculate the volume of a sphere. Take input for radius by the user. The volume of sphere is

    V = 4/3 r3

    32. Two points in a plane are specified using the coordinates (xl,y1) and (x2,y2). Write a program that accepts two

    points and determines the distance between them. The formula is :

    (X2 X1)2+ (Y2 Y1)

    2

    33. Write a program to calculate the area of a triangle given the length of its three sides a, b, and :using heron's

    formula given below :

    S= a+b+c/2

    Area=s(s-a)(s-b)(s-c)

    Chapter 5:-Branching and Looping in Python

    34. Write a program to display the first 5 multiples of 9 using :

    (i ) for loop ( i i ) while loop

    35. Write a program to input two unique numbers and find the greatest between them (using abbreviated if

    statement).

    36. Write a program to implement Fibonacci series such as : 1 1 2 3 5 8 13 . . . . upto 'N'.

    37. Write a program to enter three subject marks and calculate the total of entered marks and grades. If the total

    marks are more than 250 then the grade is 'A' otherwise 'B'.

    38. Write a program to calculate the factorial of a number.

    39. Write a program to find whether a given number is even or odd.

    40. Write a program to swap two numbers without using third variable.

  • 33

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    41. Write a program to check whether the number is perfect or not.

    42. Write a program to check whether a number is prime or not.

    43. Write a program to find sum of all even numbers and odd numbers upto 'N' numbers.

    44. Write a program to print table multiples from 1 to 10 of a given number.

    45. Write a program to find the greatest number among the three numbers.

    46. Write a program to print first 'N' natural numbers and their sum.

    47. Write a program that takes a value from the user and prints the square of it. Value should be less than 120

    48. Write a menu driven program that displays the result of the following evaluations based on the user's entry

    of choice.

    Absolute value of a number. Natural logarithm of a number.

    Square root of a number.

    A random number between 0 and 100. 49. Write a program that accepts a character from the keyboard and determines whether it is a vowel or not. If the

    given character is a vowel print ("It is a vowel.") otherwise print ("It is not a vowel.").

    50. A library issues books on rental basis as 1% charge on the cost price of the book per day. A book can be issued

    for 5 days without any late fee. If the book is returned after 5 days. a late fee will be charged for above 5 days as

    per the given table. Issue Days Late Fee per day (Z)

    1 to 5 1

    6 to 10 3.5

    more than 10 5.5

    Write a program to calculate the late fee according to the number of days.

    51. Write a program to input any 10 numbers and find their sum and average using for loop. 52. Write a program to print the mathematical tables from 1 to 10. 53. Write a program to input any number and print its digits in reverse order using while statement. The input number

    must be positive. 54. Write a program to find the greatest common divisor of given two numbers. 55. Write a program to find smallest factor of a number. 56. Write a for loop which will produce the following output (Hint: Use two nested for loops).

    1

    22

    333

    444

    5 5 5 5 5

    56. Write a program to print the following pattern using nested while loop : 1

    12

    123

    1234

    1 2 3 4 5

    57. Write a menu driven program to find the area of circle, rectangle, circumference of circle and area of square.

    58. Write a program to input number in between 1 and 100 and guess either it is too low or too high. (Hints. Use

    random function).

  • 34

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    59. Write a menu driven program to perform mathematical calculation like addition, subtraction and

    multiplication between two numbers using if...else if statements. The menu is as: Mathematical Calculation

    1. For Addition

    2. Subtraction

    3. Multiplication 4. Divi s ion

    60. Write a program to find the sum of series : 1 + x' /2! +x / 31 + ............ + xn / (n+1)!

    61. Write a program to find greatest number between 'N' numbers. 62. Write a program to find the sum of following geometric series :

    s = a + ar + ar2 + ar

    3 + ar

    4+ + arn

    63. Write a program to find armstrong (like 153 = 13 + 53 + 33+ . . . + 3N) numbers upto N. 64. Write a program to accept monthly salary from the user, and display income tax with the he of following rules :

    MONTHLY SALARY INCOME TAX

    69000 or More

    47500 68999

    47499 or Less

    20% of monthly salary

    15% of monthly salary

    10% of monthly salary

    64. For domestic consumption category, an electricity board charges according to following table:

    Load Fixed Charges (Z) Energy Charges (Z)

    0-200

    Units/pm

    201-400

    Units/pm

    Above 400

    Units/pm

    Upto 2 kw,

    Upto >2-5 kw

    Above 5 kw

    40/month

    100/month

    20/kw/month

    3.70

    3.70

    3.70

    5.50

    5.50

    5.50

    6.50

    6.50

    6.50

    Write a program to enter the sanctioned load and the number of units consumed and print out the monthly

    charges.

    65. Three natural numbers a, b and c are said to form a Pythagorean Triplet if c2= a2 + b2. Write a program to find the Pythagorean triplets for integers from I to 20.

    66. Write a program to input a number and print whether the number is a special number or not. (Note: A number is said to be a special number, if the sum of the factorial of the digits of the number is same as the original

    number, e.g., 145 is a special number, because 1! + 4! + 5! = 1 + 24 + 125 = 145)

    67. Computech company has 15 employees who have been divided into four grades as per their basic pay as follow :

    GRADE I Basic245000 p.m. or more

    D.A 40 % of Basic

    1-I.R.A 30 % of Basic GRADE II BasicZ 30000 p.m. or more but less than Z 45000

    D.A 40 % of Basic

    H.R.A : 25 % of Basic

    GRADE III Basic : Less than Z 30000 but more than Z 15000

  • 35

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    D.A : 30 % of Basic

    H.R.A : 20 % of Basic GRADE IV Basic :

    15000 p.m. or less

    D.A : 30 % of Basic

    H.R.A : 15 % of Basic

    If the salary, which is the total of Basic, D.A (Dearness Allowance) and H.R.A (House Rent Allowance), is

    above 2100000 per annum, then Income Tax at the rate of 30% of the annual salary exceeding Z100000 is

    deducted on monthly basis at source. Taking names of the employees and the basic (Monthly) pay as inputs,

    a pay slip for each employee is to be printed. Write a program to perform this job.

    68. A computerized ticket counter of an underground metro rail station charges for each ride at the following rates :

    AGE (in years) AMOUNT/HEAD

    18 or above

    5 or above but below 18

    Accompanying kids below 5

    50

    20

    NIL

    69. Write a program which takes the number of people of various age-groups as input and prints a ticket. At the end of the journey, the program states the number of passengers of different age groups who travelled and

    the total amount received as collection of fares.

    70. Write a program to prepare a frequency distribution table of the percentage marks in Computer Studies of sixty students, to be taken as inputs, into the following categories :

    The output should display the categories and the corresponding frequencies. i.e., the number of students in

    each category in two columns.

    71. Write a program to accept a date (dd/mm/yyyy) and check for the validity of the date. Chapter 6:-User-Defined Function in Python

    72. Write a function to find the sum of natural numbers up to 'N'. 73. Write a function to find the result of (a + b)2. 74. Write a function to find the sum of all odd numbers unto 'N'. 75. Write a function to calculate GCD of two numbers using function. 76. Write a function to read the values of three coefficients of a quadratic equation :

    Ax2+ Bx +C = 0 77. Find the roots of the equation and display them on the screen (including complex specifying the nature of

    roots). 78. Write aerogram using function to print the Fibonacci series up to input limit. 79. Write a function to generate and print factorial numbers up to 'N' (provided by user). 80. Write a function that interchanges the value of two integers 'A' and 'B' without using any extra

    variable. 81. Write a function which will accept the height of the person in inches and return the height in feet and

    inches in two separate variables.

    Category Marks(%)

    Fail

    Pass

    Good

    Very Good

    0 34

    35 59

    60 79

    80 and above

  • 36

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    82. Write a function to find the sum of series : 1 + 3 + 5 + 7 + 9 + 11 + ......... upto 'N' terms.

    83. Write a function to find the total number of 0's and 5's in a given number. 84. Write a function to find the sum of series : 12 + 22 + 32 + 42 + 52 + 62 + upto 'N' terms. 85. Write a program using function to find the sum of all the prime numbers between 1 and 100. Also print

    all the prime numbers between 1 and 100.

    86. Write a program to find the sum of the following series : a + ar + ar2 +...+ ar(n-1) 87. Write a program using function which accepts any text or string and prints it in reverse order.

    88. Write a function to find the sum of the following series : 1 + (1 + 2) + (1 + 2 + 3) + (1 + 2 + 3 + 4) + ........... +(1 +2+3 + 4 + . . + N)

    89. Define a function called cabmeter_calculator(km) to calculate the bill for a customer according to the given conditions :

    Kilometer Travelled (km) Fare/km(?)

    1 and 6 and 15 and 35 km 12

    UNIT 4:PROGRAMMING WITH PYTHON Chapter 1:-Working with Strings and Lists

    90. Write a program to enter your school's name and print the school's name upto its character times. 91. Write a program to count total number of characters (include spaces, except vowels) in a given string.

    92. Write a program to print all the elements of a list CDays. Where CDays is :CDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']

    93. Write a program to replace every space in a string with a hyphen (`-'). 94. Write a program to find whether two strings contain equal number of characters or not. 95. Write a function to calculate total number of characters, alphabets, digits and spaces in a string. The

    function should use a formal parameter str.

    96. Write a program to delete all the odd numbers and negative numbers in a numeric list. 97. Write a program that accepts n numbers in a list and count even numbers from the present list. 98. Write a program to print a list in reverse order. The list is as follows :CDays = ['Sunday', 'Monday',

    'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] 99. Write a program to input a string (without space(s)) and detect whether it contains alpha digit or

    alphanumeric. If the string is in form of alphabet, then check whether it is lower case or upper case alphabet. Print appropriate messages.

    100. Write a program using function to create a list of 10 integer values and insert an element at middle of the list. Print the list before insertion and after insertion of the element.

    101. Write a program that takes any message as input and prints that message without vo characters.

    102. Write an interactive program to create an integer list of 10 integers and sort the list in ascen order by using bubble sort method.

    103. Write a program to input a list Num with 10 different integer values and search a parti value and its position in that list.

    104. Write a program to create a two-dimensional list of integer type and display it in row and column

    format. The number of rows and columns will be decided at runtime of the program.

  • 37

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    105. Write a program to accept the total sale of three products by three salesmen in a double

    dimensional array. Calculate the total sale of each salesman and total sale of each product.

    106. Write a user-defined function to display the sum of column elements of a two-dimensional list R[7][7]

    containing integers.

    107. Write a user-defined function to display the sum of row elements of a two-dimensional list R[5][6]

    containing integers.

    108. Write a user-defined function to display the product of row elements of two dimensional list A[4][6]

    containing integers.

    109. Write a user-defined function to display the product of column elements of a two-dimensional list R[4]

    [4] containing integers.

    110. Write a program to display the sum of left and right diagonals of 4 x4 matrix as given below:

    11 12 23 24 15 14 17 28 19 10 11 12 13 14 15 16

    Output :

    Sum of diagonal left to right is : 52

    Sum of diagonal right to left is : 64

    111. Write a program to read the noonday temperature for each day of a month and then report the month's average noonday temperature, as well as print hottest and coolest days of that month.

    112. Write a program in Python to enter data given by the user into two 3 x 4 lists and find Sum of each element and stored as another 3 x 4 list.

    113. Write a function that checks for matching braces in an algebraic expression. If the match is successful, function returns one (1) otherwise returns zero (0).

    Chapter 2:-Working with Directories and Tuples

    114. Write a program to create a dictionary called Friends by initializing six friends roll number as key and

    name as value and print the dictionary's values only.

    115. Write a program to create a dictionary Company to store company details like its name and internet address.

    The company's name is treated as key and internet address as value. The program should ask user to enter

    details according to user choice and display all the address of the company with company name.

    116. In a school, there are 45 students in llth class. Each student has Rollno, Name, EngMarks, PhyMarks,

    ChemMarks, Math Marks and Comp Marks. Write a program to calculate and print the total of marks and

    percentage of marks for all students.

  • 38

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    Examination Sample Question Paper 2014

    Time Allowed-3 Hours Maximum Marks: 70

    General Instructions: (i) All questions are compulsory. (ii) Answer the questions after carefully reading the text.

    1.(a) What is proprietary software ?

    (b) Differentiate between LI cache and L2 cache. (c) What are the basic components of a microprocessor ? (d) What are the binary digits ? 2. (a) What is the use of USB port ? Name any three devices which are connected with USB port.

    (b) What is a system bus ? (c) Convert (100111010)2 *(?)8

    (d) List the measurement units of computer speed. 3. (a) What is debugging of program ? Given two examples of debugging techniques.

    (b) What are the different control structures used in problem solving techniques ? (c) Differentiate between a statement indent and a block indent.

    (d) What is selection structure ? Name two statements whic11 are used for selection in Python program. (e) Write an algorithm to compute the sum of the squares of 'N' numbers. (f) Draw a flowchart to check whether number 'N' is an armstrong number or not.

    4. (a) Write two advantages of using import statement in Python.

    (b) Write the equivalent Python expression for the following : 2(a

    2 + 1)

    2)

    Exp a b

    (c) Define the rules that must be followed during function call. (d) What do you mean by dictionaries in Python ? Identify the key and value from following dictionary:

    std = {"roll_no": 10, "Class": "XI", "Section": "A"}

    (e) Write two different forms of if statement. (f) What is slicing ? Name the data types which support slicing technique in Python. (g) If a, b, c are integers where a = 5, b = 3 d =1.5 then find the value for following expressions:

    (i) c = (++a) * a + d

    c = a (++b) * d ++ 1

    5. Give the output of the following program : def sumfn(last):

    Sum 1 = Sum2 = 0

    for i in range(last, 0, -3):

    Suml += i

    Sum2 += Sum 1

    print (Sum 1, " ", Sum2) def main():

    for i in range(1, 6):

    sumfn(i)

    main()

    (b) Find the output for the following: X = 2

    while (X < 7):

    print(X)

    X *= 2

  • 39

    Copyright: Govind Vidyalaya Tamulia Developed by: Vikash Anand-HOD [IT/CS]

    (c) Find the output for the following : def myst(data): for i in range(0, len(data)): Min = 0

    for j in range(i+1, len(data)): if data[j] < data[Min]: Min = j

    temp = data[Min] data[Min] = data[i] data[i] = temp

    def main():

    data = [10, -1, 4, 2]

    myst(data)