Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Computer Applications Guide Pdf Chapter 1 Multimedia and Desktop Publishing Text Book Back Questions and Answers, Notes.

Tamilnadu Samacheer Kalvi 12th Computer Applications Solutions Chapter 1 Multimedia and Desktop Publishing

12th Computer Applications Guide Multimedia and Desktop Publishing Text Book Questions and Answers

Part I

Choose The Correct Answers

Question 1.
…………….. refers to any type of application that involves more than one type of media such as text, graphics video animation and sound
a) An executable files
b) desktop publishing
c) multimedia
d) hypertext
Answer:
c) multimedia

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 2.
One of the disadvantages of the multimedia is its……………………
a) Cost
b) adaptability
c) usability
d) relativity
Answer:
a) Cost

Question 3.
Expand JPEG
a) Joint photo experts gross
b) Joint photographic experts group
c) Joint processor experts group
d) Joint photographic expression group
Answer:
b) Joint photographic experts group

Question 4.
You need hardware, software and to make multimedia
a) Network
b) compact disk drive
c) good idea
d) programming knowledge
Answer:
c) good idea

Question 5.
Match the following by choosing the right one
1. Text – TGA
2. Image – MIDI
3. Sound – MPEG
4. Video – RTF
a. 1, 2, 3, 4
b. 2, 3, 4, 1
c. 4, 1, 2, 3
d. 3, 4, 1, 2
Answer:
b. 2, 3, 4, 1

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 6.
Find the odd one on the following which is not an image format
a) TIFF
b) BMP
c) RTF
d) JPEG
Answer:

Question 7.
……………….. is the process displaying still images they give continuous movement
a) Text formats
b) Sound
c) MP3
d) Animation
Answer:
c) MP3

Question 8.
The live telecasting of real time program through Internet is known as
a) Web casting
b) web hosting
c) data manipulation
d) none of the above
Answer:
a) Web casting

Question 9.
GIF use …………… color look up table
a) 8 bit
b) 8 KB
c) 8 MB
d) 8 GB
e) 13bit
Answer:
e) 13bit

Question 10.
RTF file format was introduced by………………..
a) TCS
b) Microsoft
c) Apple
d) IBM
Answer:
b) Microsoft

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Part II

Short Answers

Question 1.
Define Multimedia and their features.
Answer:

Question 2.
List out Multimedia Components
Answer:
Multimedia has five major components are

  1. Text
  2. Images
  3. Sound
  4. Video
  5. Animation.

Question 3.
Classify the TEXT component in multimedia
Answer:

  • Static Text
  • Hypertext

Question 4.
Classify the IMAGE component in multimedia
Answer:
Images acts as an vital component in multimedia. These images are generated by the Image components are classified in two ways, as bitmap or raster images and as vector images. Raster or Bitmap Images:
The common and comprehensive form of storing images in a computer is raster or bitmap image.

Vector Images:
Drawing elements or objects such as lines, rectangles, circles and so on to create images are based on Vector images.

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 5.
Define Animation and its features
Answer:
The animation is the process of displaying still images so quickly so that they give the impression of continuous movement.

Features:

  • Using numerical transformations the movement of that image along its paths is calculated for their defining coordinates.
  • Animations may be two or three-dimensional.
  • Animation tools are very powerful and effective.

Question 6.
List out image file formats.
Answer:
TIFF (Tagged Image File Format), BMP (Bitmap), DIB (Device Independent Bitmap), GIF (Graphics Interchange Format), JPEG (Joint Photographic Experts Group), TGA (Tagra), PNG (Portable Network Graphics).

Question 7.
List out audio file formats
Answer:

  • WAV (Waveform Audio File Format)
  • MP3 (MPEG Layer-3 Format)
  • OGG
  • AIFF (Audio Interchange File Format)
  • WMA (Windows Media Audio)
  • RA (Real Audio Format)

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 8.
List out video file formats
Answer:

  • AVI (Audio/Video Interleave)
  • MPEG (Moving Picture Experts Group)
  • WMV (Windows Media Video)
  • FLV (Flash Video)
  • MKV (Matroska Video)

Question 9.
Define Multimedia Production
Answer:
In basic terms, multimedia production is any sort of production that uses imagery and a combination of text, audio, and graphics to tell a story.

Question 10.
List out Multimedia Production team members
Answer:
Production Manager, Content Specialist, Script Writer, Text Editor, Multimedia Architect, Computer Graphic Artist, Audio and Video Specialist, Computer Programmer, WebMaster.

Part III

Explain In Brief Answer

Question 1.
Briefly explain about Multimedia Components
Answer:
Multimedia has five major components like text, images, sound, video, and animation.

  1. Text: Text is the basic component of multimedia and most common ways of communicating information to other person.
  2. Image: Images act as a vital component in multimedia. These images are generated by the computer in two ways, bitmap or raster images and as vector images.
  3. Animation: Animation is the process of displaying still images so quickly so that they give the impression of continuous movement.
  4. Sound: Sound is a meaningful speech in any language and is the most serious element in multimedia, providing the pleasure of music, special effects and so on.
  5. Video: Video is defined as the display of recorded event, scene etc.

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 2.
Describe the features and techniques of animation
Answer:
The animation is the process of displaying still images so quickly so that they give the impression of continuous movement. In animation, the screen object is a vector image in the animation. Using numerical transformations the movement of that image along its paths is calculated for their defining coordinates.

The least frame rate of at least 16 frames per second gives the impression of smoothness and for natural-looking, it should be at least 25 frames per second. Animations may be in two or three-dimensional. The two-dimensional animation brings an image alive, that occurs on the flat X and Y-axis of the screen, while in three-dimensional animation it occurs along the three axis X, Y, and Z. Animation tools are very powerful and effective. The two basic types of animations are Path animation and Frame animation.

Question 3.
Write roles and responsibilities of Production team members,
Answer:

  • The production team comprises of members playing various roles and responsibilities like Scriptwriter, Production manager, Editor, Graphics Architect, Multimedia Architect, and Web Master,
  • It is for a high-end multimedia project that requires team efforts.
  • The team should understand the strength and limitations of hardware and software,

Question 4.
Describe the various file formats in multimedia.
Answer:
1) Text Formats
RTF; Rich Text Format is the primary file format introduced by Microsoft

2) Image Formats

  • GIF (Graphics Interchange Format): It is a compressed image format,
  • JPEG (Joint Photographic Experts Group):
  • It was designed to attain maximum image 1 compression,

3) Audio File Formats
• WAV (Waveform Audio File Format): It is the !j audio file format in windows
• MP3 (MPEG Layer-3 Format): MPEG Layer-3 |j format for storing and downloading music,

4) Video Fife Formats:

  • AVI (Audio/Video Interleave): It is the video file format for Windows,
  • MPEG (Moving Picture Experts Group): It is a j; standard for generating digital video and au- K dio compression,

5) Explain animation industry and its scope

  • The animation industry encompasses traditional 2D animation, 3D animation and visual effects for feature films.
  • The animation industry is expected to grow at a pace faster than the IT industries.
  • Animation as a career option is a field where you can fulfill your dream of “enjoy-as-you-work” feel satisfied at the end of your day and get praise from your clients as well.

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Part IV

Explain In Detail

Question 1.
Explain in detail the Process of Multimedia.
Answer:

Adequate time and efficient planning is required for multimedia production, which assures that the project will proceed smoothly and certainly ensures that the information reaches the target audience. Following are the phases for the development of complex multimedia projects. Multimedia and Desktop Publishing.

Conceptual Analysis and Planning:
The process of multimedia making begins with a conceptual ignition point. Conceptual analysis identifies a appropriate theme, budget and content availability on that selected theme. Additional criteria like copyright issues also are considered in this phase.

Project design:
Once the theme is finalized objectives, goals, and activities are drawn for the multimedia project. General statements are termed as goals. The specific statements in the project is known as the objectives. Activities are series of actions performed to implement an objective. These activities contribute to the Project design phase.

Pre-production:
Based on the planning and design, it is necessary to develop the project.
The following are the steps involved in pre-production:

Budgeting:
Budgeting for each phases like consultants, hardware, software, travel, communication and publishing is estimated for all the multimedia projects.

Multimedia Production Team:
The production team for a high-end multimedia project requires a team efforts. The team comprises of members playing various roles and responsibilities like Script writer, Production manager, Editor, Graphics Architect, Multimedia Architect and Web Master.

Hardware/Software Selection:
All multimedia Application requires appropriate tools to develop and playback the application. Hardware includes the selection of fastest CPU, RAM and huge monitors, sufficient disc for storing the records. Selection of the suitable software and file formats depends on the funds available for the project being developed.

Defining the Content:
Content is the “stuff’ provided by content specialist to the multimedia architect with which the application is developed, who prepares the narration, bullets, charts and tables etc.

Preparing the structure:
A detailed structure must have information about all the steps ‘along with the time line of the future action. This structure defines the activities, responsible person for each activity and the start/end time for each activity.

Production:
In the multimedia application, after the pre-production activities, the production phase starts. This phase includes the activities like background music selection, sound recording and so on. Text is incorporated using OCR software, Pictures shot by digital camera, Video clips are shot, edited and compressed. A pilot project is ready by this time.

Testing:
The complete testing of the pilot product is done before the mass production to ensure that everything is in place, thereby avoiding the failure after launch. If it’s an web . based product its functioning is tested with different browsers like Internet Explorer, Chrome, Mozilla and Netscape Navigator. If it is a locak multimedia application on a LAN it must be deployed in the server for testing purpose. After the testing process are over, the product is incorporated with valid suggested changes.

Documentation User documentation is a mandatory feature of all multimedia projects. The documentation has all the valuable information’s starting from the system requirement till the completion of testing. Contact details, e-mail address and phone numbers are provided for technical support and sending suggestions and comments.

Delivering the Multimedia Product:
Multimedia applications are best delivered on CD/DVD or in the website. In reality, various challenges are faced while delivering through internet, like bandwidth problems, huge number of plug-ins required to play audio and video and long downloading time. Finally, a multimedia application is delivered in a more effective way by the integration of two mediums CD-ROM/DVD and Internet.

Question 2.
Explain in detail Techniques of Animation
Answer:

  • Animation is the process displaying still images so quickly so that they give the impression of continuous movement.
  • In animation the screen object is a vector image in animation. Using numerical transformations the movement of that image along its paths is calculated for their defining coordinates.
  • The least frame rate of at least 16 frames per second gives the impression of smoothness and for natural looking it should be at least 25 frames per second.
  • Animations may be in two or three dimensional, jj The two dimensional animation, bring an image alive, that occur on the flat X and Y axis of the screen.
  • While in three dimensional animation it occurs along the three axis X, Y and Z. The two basic types of animations are Path animation and Frame animation.

Path Animation
Path animation involves moving an object on a screen that has a constant background

Frame Animation
In frame animations, multiple objects are allowed to travel simultaneously and the background or the objects also changes.

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 3.
Explore the opportunities Animation filed movie industry.
Answer:

In India, the VFX domain, or the animation and visual effects industry has been growing stronger and stronger in recent years.

  1. Animation and visual effects requirement for massive international projects such as HBO’s top TV series and Marvels’ hit Infinity War and Black Panther was outsourced to Indian companies in Mumbai and Pune.
  2. This led to a significant increase in the number of students enrolling for a VFX course.
  3. As such, a student that completes a 3D animation course cap hope to build a rewarding and satisfying career in the Media and Entertainment field these days.
  4. The timeless classics Tom and Jerry and Mickey Mouse created a milestone but the legacy is not disappointing.
  5. Indian animation has risen from an amateur piece of craft like “The Banyan Deer” to the million rupees project “Chhota Bheem”
  6. POGO, the leading cartoon channel in India is the most successful entertainment channel for kids.
  7. Indian animation industry is anticipated to grow faster than the IT industry.
  8. The industry has grown to a multibillion net work standard.
  9. As a result of the growing demand in industry, the scope of animation course in tremendous.
  10. The number of VFX artists and animators that worked on Baahubali was around 750.
  11. Ex. For Top animates Movies: Spider-Man, Incredibles 2, Zootopia, Inside Out, Toy Story 3, Finding Nemo, Frozen, etc.

Question 4.
Explain in detail about production team Roles and Responsibilities
Answer:
1. Production Manager
The production manager should be an expert in technology expert, good at proposal writing, good communication skills, budget management skills, human resource management and act as an efficient team leader.

2. Content Specialist
Content specialist is responsible for performing all research activities concerned with the proposed application’s content.

3. Script Writer
The scriptwriter visualizes the concepts in three-dimensional environments and if needed uses the virtual reality integration into the program.

4. Text Editor
The content of a multimedia production always must flow logically and the text should always be structured and correct grammatically.

5. Multimedia Architect
The multimedia architect integrates all the multimedia building blocks like graphics, text, au-dio, music, video, photos and animation by using authoring software.

6. Computer Graphic Artist
The role of Computer Graphic Artist is to deal with the graphic elements of the programs like backgrounds, bullets, buttons, pictures editing, 3-D objects, animation, and logos etc.

7. Audio and Video Specialist
The roles of these specialists are needed for dealing with narration and digitized videos to be added in a multimedia presentation. They are responsible for recording, editing sound effects and digitizing.

8. Computer Programmer
The computer programmer writes the lines of code or scripts in the appropriate language.

9. WebMaster
The responsibility of the webmaster is to create and maintain an Internet web page. They convert a multimedia presentation into a web page.

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 5.
Explain about different file formats in multimedia files
Answer:
a) Text Formats
RTF: Rich Text Format is the primary file format introduced in 1987 by Microsoft

b) Image Formats

  • GIF (Graphics Interchange Format): GIF is a compressed image format. Most of the computer color images and backgrounds are GIF files.
  • JPEG (Joint Photographic Experts Group) : JPEG was designed to attain maximum im-age compression. It uses lossy compression technique,

c) Audio File Formats

  • WAV (Waveform Audio File Format): It is the most popular audio file format in windows for storing uncompressed sound files.
  • MP3 (MPEG Layer-3 Format): MPEG Layer-3 format is the most popular format for storing and downloading music.

d) Digital Video File Formats

  • AVI (Audio/Video Interleave) :AVI is the video file format for Windows. Here sound and picture elements are stored in alternate interleaved chunks in the file.
  • MPEG (Moving Picture Experts Group): MPEG is a standard for generating digital video and audio compression under the International Standards Organization (ISO) by the group of people.

12th Computer Applications Guide Multimedia and Desktop Publishing Additional Important Questions and Answers

Part A

Choose The Correct Answers:

Question 1
……………………….. applications play a vital role in presenting information to the user.
(a) Powerpoint
(b) Multimedia
(c) Star office
(d) PHP
Answer:
(b) Multimedia

Question 2.
Multimedia has …………… major components
a) 2
b) 3
c) 4
d) 5
Answer:
d) 5

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 3.
What is the plural form of the medium?
(a) medium
(b) mediu
(c) media
(d) median
Answer:
(c) media

Question 4.
Classifications of text are and
a) Static and Hypertext
b) Static and Text
c) Hyper and Text
d) All of the above
Answer:
a) Static and Hypertext

Question 5.
Which is not a multimedia component? [Pick the odd one out].
(a) Test
(b) Image
(c) Sound
Answer:
(a) Test

Question 6.
Images are generated by the computer In ……………..ways.
a) 2
b) 3
c) 4
d) 5
Answer:
a) 2

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 7.
Each pixel consists of colours,
a) two
b) two or more
c) one
d) None of these
Answer:
b) two or more

Question 8.
Vector Images are used to create……………… Objects.
a) Lines
b) Rectangle
c) Circle
d) All of the above
Answer:
d) All of the above

Question 9.
The readability of the text depends on the ………………………….
(a) pronunciation
(b) spacing
(c) punctuation
(d) b & c
Answer:
(d) b & c

Question 10.
……………..is the process of conducting a conference between more than two participants at different sites by using computer networks
a) Video conferencing
b) Webcasting
c) Web hosting
d) All of the above
Answer:
a) Video conferencing

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 11.
……………… is a free-standing furnished equipped multimedia computer that allows users to retrieve information via a touch screen.
a) Kiosk
b) Maya
c) PHP
d) Python
Answer:
a) Kiosk

Question 12.
Kiosk is usually located near the entrance of the ……………, used for displaying announcements,
a) Library
b) Railway Station
c) Airport
d) Colleges
Answer:
a) Library

Question 13.
Which of the following is not a role of the Multimedia production team?
a) Text Editor
b) Script Writer
c) Production Manager
d) None of these
Answer:
d) None of these

Question 14.
Rich Text Format is the primary file format introduced in………….
a) 1989
b) 1999
c) 1997
d) 1987
Answer:
d)1987

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 15.
In determining the number of colors, ……………………. bits indicates 256 colors.
(a) 2
(b) 4
(c) 8
(d) 16
Answer:
(c) 8

Question 16.
Match the following
Notepad – 1) Unix, Linux
Gedit or nano – 2) Mac OSX
TextEdit – 3) Windows
Choose the correct order
a) 3 1 2
b) 1 2 3
c) 2 3 1
d) 3 2 1
Answer:
Notepad – 1) Unix, Linux

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 17.
………………….. image format is used for high-resolution or large images.
a) TIFF
b) GIF
c) BMP
d) JPEG
Answer:
c) BMP

Question 18.
Most of the computer color images and backgrounds are ………….. files.
a) TIFF
b) GIF
c) BMP
d) JPEG
Answer:
b) GIF

Question 19.
How many frames per second are needed for normal natural-looking images?
(a) 10
(b) 15
(c) 20
(d) 25
Answer:
(d) 25

Question 20.
Which of the following audio file format used by apple?
a) WAV
b) RA
c) OGG
d) AIFF
Answer:
d) AIFF

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 21.
……………… format is designed for streaming audio over the Internet.
a) WAV
b) RA
c) OGG
d) AIFF
Answer:
b) RA

Question 22.
How many types of animations are there?
(a) 2
(b) 3
(c) 4
Answer:
(a) 2

Question 23.
The process of multimedia making begins with
a) Conceptual Analysis and Planning
b) Project design
c) Pre-production
d) Budgeting
Answer:
a) Conceptual Analysis and Planning

Question 24.
Copyright issues also are considered in
a) Conceptual Analysis and Planning
b) Project design
c) Pre-production
d) Budgeting
Answer:
a) Conceptual Analysis and Planning

Question 25.
………….. is estimated for all the multimedia projects.
a) Conceptual Analysis and Planning
b) Project design
c) Pre-production
d) Budgeting
Answer:
d) Budgeting

Question 26.
Which one of the following is the most serious element in multimedia and provides the pleasure of music, special effects, etc?
(a) Text
(b) Image
(c) Sound
(d) Video
Answer:
(c) Sound

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 27.
………….. phase includes the activities like background music selection, sound recording
a) Testing
b) Production
c) Delivering the Multimedia Product
d) Documentation
Answer:
b) Production

Question 28.
Which of the following is related to documentation?
a) Contact details
b) e-mail address
c) Phone numbers
d) All of the above
Answer:
d) All of the above

Question 29.
………………………….. Sound is a digitized sound.
(a) Recorded
(b) Digital
(c) Frame
(d) Sampled
Answer:
(d) Sampled

Question 30.
The ……………… visualizes the concepts in three-dimensional environments and if needed uses the virtual reality integration into the program.
a) Scriptwriter
b) Production manager
c) Editor
d) Content specialist
Answer:
a) Scriptwriter

Question 31.
The ……………….. integrates all the multimedia building blocks
a) Scriptwriter
b) Multimedia Architect
c) Editor
d) WebMaster
Answer:
b) Multimedia Architect

Question 32.
The responsibility of the ……………….. is to create and maintain an Internet web page.
a) Scriptwriter
b) Multimedia Architect
c) Editor
d) WebMaster
Answer:
d) WebMaster

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 33.
How many categories of Analog videos are there?
(a) 1
(b) 2
(c) 3
(d) 4
Answer:
(b) 2

Question 34.
Research on MPEG-21 “Multimedia Framework” has started in………………
a) 2000
b) 2001
c) 2002
d) 2003
Answer:
a) 2000

Question 35.
Which video format produces low polarity videos?
(a) Analog video
(b) Digital video
(c) Component Analog Video
(d) Composite Analog Video
Answer:
(d) Composite Analog Video

Fill In The Blanks;

1. The Word Multimedia means ………………
Answer:
Multiple forms of media

2. Raster images are also called as ………………
Answer:
Bitmap Images

3. Bitmap is a simple matrix of the tiny dots called ………………
Answer:
Pixel

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

4. ………………techniques are used to reduce the file size of images
Answer:
Compression

5. Video can be categorized in ………………types
Answer:
2

6. ………………and……………… are the categories of video
Answer:
Analog video and Digital video.

7. ………………is the measurement of volume.
Answer:
Decibels

8. A sample of ………………is taken and stored every nth fraction of a second as digital information in bits and bytes.
Answer:
Sound

9. ………………is defined as the display of recorded event, scene, etc.
Answer:
Video

10. The powerful way to convey information in multimedia applications are ………………
Answer:
embedding of video.

11. In ………………, the video data’s are stored in any non-computer media.
Answer:
Analog video

12. Analog video is divided into ………………types.
Answer:
2

13. ………………and ………………are the types of analog video
Answer:
Composite and Component

14. The File extension of WAV files is………………
Answer:
wav

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

15. The File extension of MPEG Layer-3 files is………………
Answer:
mp3

16. The specific statements in the project is known as the ………………
Answer:
Objectives.

17. Multimedia based teaching and learning system named as ………………at GMU.
Answer:
MODULO

18. Banks uses ………………in the form of ATM machines.
Answer:
Kiosks

19. Initially Bitmap format is in use with ………………OS
Answer:
Windows 3.1.

20. Text is incorporated using ………………software
Answer:
OCR

21. ……………… tool is flexible and easy for composing the projects in multimedia.
Answer:
MIDI

Abbreviation

  1. TIFF -Tagged Image File Format
  2. JPEG -Joint Photographic Experts Group
  3. MIDI -Musical Instrument Digital Identifier
  4. RTF -Rich Text Format
  5. BMP -Bitmap
  6. GIF -Graphics Interchange Format
  7. TGA -Tagra
  8. PNG -Portable Network Graphics
  9. WAV -Waveform Audio File Format
  10. MP3 -MPEG Layer-3 Format
  11. AIFF -Audio Interchange File Format
  12. WMA -Windows Media Audio
  13. RA -Real Audio Format
  14. AVI -Audio Video Interleave
  15. MPEG -Moving Pictures Experts Group
  16. ISO -International Standard Organization
  17. LAN -Local Area Network
  18. EDUSAT -Education Satellite
  19. DIB -Device Independent Bitmap
  20. DRM -Digital Right Management

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Assertion And Reason

Question 1.
Assertion (A): The word multimedia consists of two words “multi” and “media”
Reason (R): Multimedia means that multiple forms of media are combined to gather and provide services
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)

Question 2.
Assertion (A): Text is the basic components of multimedia
Reason (R): It is one of the most common ways of communicating information to another person.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)

Question 3.
Assertion (A); Static text, the text or the words will remain static as a heading or in a line, or in a paragraph.
Reason (R): The words are given along with the images to explain the images.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 4.
Assertion (A): A hypertext is a system which consists of nodes, the text and the links between the nodes.
Reason (R): It defines the paths the user needs to follow for the text access in non-sequential ways.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)

Question 5.
Assertion (A): Images act as a vital component in multimedia.
Reason (R): These images are generated by the computer in three ways
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
c) (A) is true and (R) is false

Question 6.
Assertion (A): Pixel is nothing but a picture element
Reason (R): Pixel is a physical point (tiny dots) in a raster image
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)

Question 7.
Assertion (A): Multimedia conferencing or video conferencing is a system that performs face-to-face interactions among participating users.
Reason (R): Located far from each other, as if they were sitting and discussing in a single room.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 8.
Assertion (A): Animation is the process of displaying still images so quickly so that they give the impression of continuous movement.
Reason (R): In animation, the screen object is a bitmap image in the animation.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
c) (A) is true and (R) is false

Question 9.
Assertion (A): Path animation involves moving an object on a screen that has a constant background.
Reason (R): A cartoon character may move
across the screen regardless of any change in the background or the character.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)

Question 10.
Assertion (A) MIDI is a standard communication tool developed for computers and electronic instruments.
Reason (R): This tool is flexible and easy for composing projects in multimedia. Tools for synthesizing the sound and software for sequencing are necessary forMIDI.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)

Question 11.
Assertion (A): In frame animations, only two objects are allowed to travel simultaneously. Reason (R): In frame animations, the
background or the objects also changes.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
d) (A) is false and (R) is true

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 12.
Assertion (A): Sound is a meaningful speech in any language and is the most serious element in multimedia, providing the pleasure of music, special effects, and so on.
Reason (R): Decibels are the measurement of volume, the pressure level of sound.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)

Question 13.
Assertion (A): JPEG was designed to attain maximum age compression.
Reason(R): It uses lossless compression technique, where a compression method
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
c) (A) is true and (R) is false

Question 14.
Assertion (A): The process of multimedia making begins with a conceptual ignition point. Reason(R): Conceptual analysis identifies an appropriate theme, budget and content available on that selected theme.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)

Question 15.
Assertion (A): Once the theme is finalized objectives, goals, and activities are drawn for the multimedia project.
Reason(R): General statements are termed as goals. The specific statements in the project are known as the objectives.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 16.
Assertion (A): All multimedia Application requires appropriate tools to develop and playback the application.
Reason(R): Hardware includes the selection of the fastest CPU, RAM and huge monitors, sufficient disc for storing the records.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)

Question 17.
Assertion (A): Content is the “stuff ” provided by content specialist to the multimedia architect with which the application is developed, Reason(R); Content specialist prepares the narration, bullets, charts and tables.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)

Question 18.
Assertion (A): In the multimedia application, after the pre-production activities, the production phase starts.
Reason(R); This phase includes the activities like background music selection, sound recording and so on.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)

Question 19.
Assertion (A): In multimedia production, the role of the production manager is to define, and coordinate, the production of the multimedia project in time and with full quality.
Reason(R): The production manager should be an expertise in technology expert, good at proposal writing, good communication skills and budget management skills.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 20.
Assertion (A): The content specialist is not responsible for performing all research activities concerned with the proposed application’s content.
Reason(R): Program content refers to projects
information, graphics, data, or facts presented through multimedia production.
a) Both (A) and (R) are correct and (R) is the correct explanation of (A)
b) Both (A) and (R) are correct, but (R) is not the correct explanation of (A)
c) (A) is true and (R) is false
d) (A) is false and (R) is true
Answer:
d) (A) is false and (R) is true

Find The Odd One On The Following

1. (a) Video
(b) Text
(c) Animation
(d) Audio
Answer:
(b) Text

2. (a) Sound
(b) Video
(c) Graphics
(d) Image
Answer:
(c) Graphics

3. (a) Videotape
(b) Laserdisc
(c) Film
(d) Pen drive
Answer:
(d) Pen drive

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

4. (a) Dots
(b) Rectangles
(c) Lines
(d) Circles
Answer:
(a) Dots

5. (a) GIF
(b) RTF
(c) TIFF
(d)JPEG
Answer:
(b) RTF

6. (a) Bit depth
(b) Resolutions
(c) Decibels
(d) Sample size
Answer:
(c) Decibels

7. (a) Notepad
(b) Gedit
(c) Paint
(d) Nano
Answer:
(c) Paint

8. (a) Flash
(b) Picasa
(c) Photoshop
(d) Text Edit
Answer:
(d) Text Edit

9. (a) TIFF
(b) MPEG
(c) GIF
(d)JPEG
Answer:
(b) MPEG

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

10. (a) RA
(b) AVI
(c) WMA
(d) AIFF
Answer:
(b) AVI

11. (a) Background
(b) Digitizing
(c) Bui Sets
(d) Picture editing
Answer:
(b) Digitizing

12. (a) Recording
(b) Editing
(c) Animation
(d) Sound Effects
Answer:
(c) Animation

13. (a) Script Writer
(b) Text Editor
(c) Multimedia Player
(d) WebMaster
Answer:
(c) Multimedia Player

14. (a) MODULO
(b) EDUSAT
(c) BYJUS
(d) MIDI
Answer:
(d) MIDI

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

15. (a) Scanned Image
(b) Digital Books
(c) Graphics
(d) Nodes
Answer:
(d) Nodes

Choose The Incorrect Pairs:

1. a) Hyper Text, Static text
b) Raster Image, Vector Image
c) Path Animation, Frame Animation
d) JPEG, MPEG
Answer:
d) JPEG, MPEG

2. a) Webcasting and Video Conferencing
b) Audio and Video Specialist
c) Real Audio Format and Tagra
d) Hardware and Software Selection
Answer:
c) Real Audio Format and Tagra

3. a) Sound, Decibel
b) Bitmap, Static Text
c) Hypertext, Links
d) Animation, Vector Image
Answer:
b) Bitmap, Static Text

4. a) Library, Multimedia Kiosk
b) Medical Services, Tiny digital cameras
c) Business Systems, High resolution projectors
d) EDUSAT, Entertainment
Answer:
d) EDUSAT, Entertainment

5. a) GIF, 13-bit Color lookup table
b) Animation, 25 Frames
c) Raster Images, 256 colors
d) Multimedia, 6 components.
Answer:
d) Multimedia, 6 components.

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Part B

Short Answers

Question 1.
What are the advantages of vector images?
Answer:
A relatively small amount of data is required to represent the image and thereby only less memory is needed to store.

Question 2.
What are the various of Digital Media?
Answer:
Information are available in digital formats that include digital books, scanned images, graphics, and digitized audio-visual clips, etc stored in Digital Multimedia Library.

Question 3.
Mention some compression formats?
Answer:

  1. GIF – Graphics Interface Format
  2. TIFF – Tagged Image File Format
  3. JPEG – Joint Photographic Experts Group

Question 4.
Write a short note on Vector Images.
Answer:
Drawing elements or objects such as lines, rectangles, circles and so on to create an images are based on Vector images.

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 5.
What are the advantages of Vector Images?
Answer:

  • A relatively small amount of data is required to represent the image and thereby only less memory is needed to store.
  • Compression techniques are used to reduce the file size of images that is useful for storing a large number of images and speeding transmission for networked application.

Question 6.
Write a note on MIDI?
Answer:
Musical Instrument Digital Identifier (MIDI) is a standard communication tool developed for computers and electronic instruments. This tool is flexible and easy for composing the projects in multimedia. Tools for synthesizing the sound and software for sequencing are necessary for MIDI.

Part C

Explain In Brief Answer

Question 1.
Write a short note on Hypertext.
Answer:

  • A hypertext is a system which consists of nodes, the text, and the links between the nodes, which defines the paths the user; needs to follow for the text access in non-sequential ways.
  • The author of the working system created this structure. The user is permitted to define their own paths in more sophisticated hypertext systems.
  • The user is provided with the flexibility and choice to navigate in hypertext.

Question 2.
Define composite Analog video? Mention same characteristics of composite Analog video?
Answer:
Composite Analog Video has all the video components like brightness, color, and synchronization combined into one signal. Due to the combining of the video components, the quality of the composite video resulted in color blending, low clarity and high generational loss.

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Question 3.
How Multimedia is used in Entertainment?
Answer:

  • The remarkable advancement in the entertainment industry is due to the Multimedia Technology mainly.
  • Thistechnology is needed in all mode of entertainment like radio, TV, online gaming, vid-eo on demand etc.
  • Video on demand or movies on demand is a service that provides movies to television sets on an individual basis at homes.
  • Movies are stored in a centralserver and transmitted througha communication network.

Question 4.
How Multimedia is used InMedicitl Services?
Answer:

  • Medical services are grown drastically with the development of multimedia.
  • Medical Students practices surgery methods via simulation prior toactual surgery.
  • Tiny digital camerasare inserted in human body and it displays the inner scene of the body.
  • In this way the medical practitioners were able to see the inner part without dissecting it.

Question 5.
Explain PNG format?
Answer:
An extensible file format for the less loss, portable and well-compressed storage of raster images. PNG acts as a replacement for GIF and also replaces multiple common uses of TIFF. PNG works good with online viewing applications like world wide web. so it is fully streameable with a best display option.

Question 6.
How Multimedia is used in Multimedia Conferencing
Answer:
Multimedia conferencing or video conferencing is a system that performs face-to-face interaction samong participating users, located far from each other, as if they weresitting and discussing in a ‘ single room.

Samacheer Kalvi 12th Computer Applications Guide Chapter 1 Multimedia and Desktop Publishing

Part D

Explain In Detail

Question 1.
How Multimedia is used in Business systems?
Answer:

  • Business applications for multimedia include presentations, training, and internet protocols and soon.
  • The marketing and advertising agencies are using animation techniques for sales promotion.
  • Multimedia is used very commonly for building employee ID.
  • High-resolution projectors are common for multi-media presentations on the road.
  • Cell phones and personal digital assistants with Bluetooth and Wi-Fi communication technology make multimedia communication for business more efficient.

Question 2.
Explain various components of Multimedia?
Answer:
Multimedia has five major components like text, images, sound, video and animation. They are explained in detail below:
1. Text:
is the basic components of multimedia and most common ways of communicating information to other person. Static text, the text or the words will remain static as a heading or in a line, or in a paragraph. A hypertext is a system which consists of nodes, the text and the links between the nodes, which defines the paths the user need to follow for the text access in non-sequential ways.

2. Images:
acts as an vital component in multimedia. These images are generated by the computer in two ways, as bitmap or raster images and as vector images. Raster or Bitmap Images: The common and comprehensive form of storing images in a computer is raster or bitmap image.

3. Vector images:
Drawing elements or objects such as lines, rectangles, circles and so on to create an images are based on Vector images.

Animation is the process displaying still images so quickly so that they give the impression of continuous movement. Path animation involves moving an object on a screen that has a constant background e g. a cartoon character may move across the screen regardless of any change in the background or the character.

4. Frame animation:
In frame animations, multiple objects are allowed to travel simultaneously and the background or the objects also changes.

5. Sound:
Sound is a meaningful speech in any language and is the most serious element in multimedia, providing the pleasure of music, special effects and so on.

6. Video:
is defined as the display of recorded event, scene etc. The powerful way to convey information in multimedia applications are embedding of video. The video can be categorized in two types as Analog video and Digital video.

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Computer Science Guide Pdf Chapter 7 Python Functions Text Book Back Questions and Answers, Notes.

Tamilnadu Samacheer Kalvi 12th Computer Science Solutions  Chapter 7 Python Functions

12th Computer Science Guide Python Functions Text Book Questions and Answers

I. Choose the best answer (I Marks)

Question 1.
A named blocks of code that are designed to do one specific job is called as
a) Loop
b) Branching
c) Function
d) Block
Answer:
c) Function

Question 2.
A Function which calls itself is called as
a) Built-in
b) Recursion
c) Lambda
d) return
Answer:
b) Recursion

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 3.
Which function is called anonymous un-named function PTA –
a) Lambda
b) Recursion
c) Function
d) define
Answer:
a) Lambda

Question 4.
Which of the following keyword is used to begin the function block?
a) define
b) for
c) finally
d) def
Answer:
d) def

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 5.
Which of the following keyword is used to exit a function block?
a) define
b) return
c) finally
d) def
Answer:
b) return

Question 6.
While defining a function which of the following symbol is used.
a) ; (semicolon)
b) . (dot)
c) : (colon)
d) $ (dollar)
Answer:
c): (colon)

Question 7.
In which arguments the correct positional order is passed to a function?
a) Required
b) Keyword
c) Default’
d) Variable-length
Answer:
a) Required

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 8.
Read the following statement and choose the correct statement(s).
I) In Python, you don’t have to mention the specific data types while defining function.
II) Python keywords can be used as function name.
a) I is correct and II is wrong
b) Both are correct
c) I is wrong and II is correct
d) Both are wrong
Answer:
a) I is correct and II is wrong

Question 9.
Pick the correct one to execute the given statement successfully, if ………… : print
(x, ” is a leap year”)
a) x%2=0
b) x%4==0
c) x/4=0
d) x%4=0
Answer:
b) x%4==0

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 10.
Which of the following keyword is used to define the function testpython(): ?
a) define
b) pass
c) def
d) while
Answer:
c) def

II. Answer the following questions (2 Marks)

Question 1.
What is a function?
Answer:
Functions are named blocks of code that are designed to do a specific job. If you need to perform that task multiple times throughout your program, you just call the function dedicated to handling that task.

Question 2.
Write the different types of functions.
Answer:

  1. User-defined functions
  2. Built-in functions
  3. Lambda functions
  4. Recursive functions

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 3.
What are the main advantages of function?
Answer:

  • It avoids repetition and makes high degree of code reusing.
  • It provides better modularity for your application.

Question 4.
What is meant by scope of variable? Mention its types.
Answer:

  • Scope of variable refers to the part of the program, where it is accessible, i.e., area where the variables can refer (use).
  • The scope holds the current set of variables and their values.
  • The two types of scopes are – local scope and global scope

Question 5.
Define global scope.
Answer:
A variable, with global scope can be used anywhere in the program. It can be created by defining a variable outside the scope of any function/block.

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 6.
What is the base condition in a recursive function
Answer:

  • A recursive function calls itself. Imagine a process would iterate indefinitely if not stopped by some condition. Such a process is known as infinite iteration.
  • The condition that is applied in any recursive function is known as a base condition.
  • A base condition is must in every recursive function otherwise it will continue to execute like an infinite loop.

Question 7.
How to set the limit for recursive function? Give an example.
Answer:
Python also allows you to change the limit using sys.setrecursionlimit (limit value).
Example:
import sys
sys.setrecursionlimit(3000)
def fact (n):
if n = = 0:
return 1
else:
return n * fact (n – 1)
print (fact (2000))

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

III. Answer the following questions (3 Marks)

Question 1.
Write the rules of the local variable.
Answer:

  • A variable with a local scope can be accessed only within the function or block that it is created in.
  • When a variable is created inside the function/block, the variable becomes local to it.
  • A local variable only exists while the function is executing.
  • The format arguments are also local to function.

Question 2.
Write the basic rules for a global keyword in python.
Answer:

  • When we define a variable outside a function, it’s global by default. We don’t have to use the global keyword.
  • We use a global keyword to read and write a global variable inside a function.
  • Use of global keyword outside a function has no effect.

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 3.
What happens when we modify the global variable inside the function?
Answer:
It will change the global variable value outside the function also.

Question 4.
Differentiate ceil() and floor() function?

Cell()

Floor ()

ceil () returns the smallest integer greater than or equal to the given value. floor() returns the largest integer less than or equal to the given value.

Question 5.
Write a Python code to check whether a given year is leap year or not
Answer:
n = int (input(“Enter any year”))
if (n % 4 = = 0):
print “Leap year”
else:
print “Not a Leap year”
Output:
Enter any year 2001
Not a Leap year

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 6.
What is a composition in functions?
Answer:

  • The value returned by a function may be used as an argument for another function in a nested manner is called composition.
  • For example, if we wish to take a numeric value or an expression as a input from the user, we take the input string from the user using the function input() and apply eval() function to evaluate its value

Question 7.
How recursive function works?
Answer:

  • Recursive function is called by some external code.
  • If the base condition is met then the program gives meaningful output and exits.
  • Otherwise, the function does some required processing and then calls itself to continue recursion.

Question 8.
What are the points to be noted while defining a function?
Answer:

  • Function blocks begin with the keyword “def”followed by function name and parenthesis() .
  • Any input parameters or arguments should be placed within these parentheses when you define a function.
  • The code block always comes after colon(;) and is indented.
  • The statement “return [expression]” exits a function, optionally passing back an expression to the caller.
  • A “return” with no arguments is the same as return None.

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

IV. Answer the following questions (5 Marks)

Question 1.
Explain the different types of function with an example.
Answer:

Functions

Description

User-defined functions Functions defined by the users themselves
Built-in functions Functions that are inbuilt within Python.
Lambda functions Functions that are anonymous un-named function.
Recursive functions Functions that call themselves is known as recursive.

1. User-defined function:
Functions defined by the users themselves are called User-defined functions.
Syntax:
def :
< Block of statement >
return < expression / None>
Example:
def welcome():
print(“Welcome to Python”)
return

2. Built-in functions:
Functions which are using Python libraries are called Built-in functions.
Example:
x=20
y=-23
print(‘First number = ” ,x)
print(‘Second number = ” ,y)
Output:
First number = 20
Second number = 23
3. Lambda function:

  • Lambda function is mostly used for creating small and one-time anonymous function.
  • Lambda functions are mainly used in combination with the functions like filter]), map]) and reduce]).
    Syntax of Lambda function (Anonymous Functions):
    lambda [argument(s)]: expression

Example:
sum = lambda arg1, arg2: arg1 + arg2
print (The Sum is :’, sum(30, 40)
print (The Sum is sum(-30, 40)

Output:
The Sum is: 70
The Sum is: 10

4. Recursive function:

  • A recursive function calls itself. Imagine a process would iterate indefinitely if not stopped by some condition! Such a process is known as infinite iteration.
  • The condition that is applied in any recursive function is known as a base condition.
  • A base condition is must in every recursive function otherwise it will continue to execute like an infinite loop.
  • Overview of how recursive function works:
  • Recursive function is called by some external code.
  • If the base condition is met then the. program gives meaningful output and exits.
  • Otherwise, function does some required processing and then calls itself to continue recursion.
    Here is an example of recursive function used to calculate factorial.

Example:
def fact(n):
if n==0:
return 1
else:
return n * fact (n-1)
print (fact (0))
print (fact (5))

Output:
1
120

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 2.
Explain the scope of variables with an example.
Answer:
Scope of Variables:
Scope of variable refers to the part of the program, where it is accessible, i.e., an area where you can refer (use) it. We can say that scope holds the current set of variables and their values.
The two types of scopes are local scope and global scope.

(I) Local scope:
A variable declared inside the function’s body or in the local scope is called a local variable.

Rules of local variable:

  1. A variable with local scope can be accessed only within the function/block that it is created in.
  2. When a variable is created inside the function/block; the variable becomes local to it.
  3. A local variable only exists while the function is executing.
  4. The formate arguments are also local to function.

Example: Create a Local Variable
def loc ( ):
y = 0 # local scope
print (y)
loc ( )
Output:
0
(II) Global Scope:
A variable, with global scope can be used anywhere in the program. It can be created by defining a variable outside the scope of any function/block.

Rules of global Keyword:
The basic rules for global keyword in Python are:

  1. When we define a variable outside a function, it’s global by default. You don’t have to useglobal keyword.
  2. We use global keyword to read and write a global variable inside a function.
  3. Use of global keyword outside a function has no effect

Example: Global variable and Local variable with same name
x = 5 def loc ( ):
x = 10
print (“local x:”, x)
loc ( )
print (“global x:”, x)
Output:
local x: 10
global x: 5
In the above code, we used same name ‘x’ for both global variable and local variable. We get a different result when we print same variable because the variable is declared in both scopes, i.e. the local scope inside the function loc() and global scope outside the function loc ( ).
The output:- local x: 10, is called local scope of variable.
The output: – global x: 5, is called global scope of variable.

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 3.
Explain the following built-in functions.
Answer:
a) id()
b) chr()
c) round ()
d) type()
e) pow()
Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions 1
Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions 2

Question 4.
Write a Python code to find the L.C.M. of two numbers.
Answer:
Program:
# Python Program to find the L.C.M. of two input number
defcompute_lcm(x, y):
# choose the greater number
if x > y:
greater = x
else:
greater = y
while (True):
if((greater % x == 0) and (greater % y == 0)):
1cm = greater
break
greater += 1
return 1cm
num1=int(input(//Enter first number=”))
num2=int(input(“Enter second number=”))
print
(“The L.C.M. is”, compute_lcm(num1, num2))
Output:
Enter first number=8
Enter second number=4
The L.C.M. is 8

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 5.
Explain the recursive function with an example.
Answer:
Python recursive functions
When a function calls itself is known as recursion. Recursion works like loop but sometimes it makes more sense to use recursion than loop. You can convert any loop to recursion.
A recursive function calls itself. Imagine a process would iterate indefinitely if not stopped by some condition! Such a process is known as infinite iteration. The condition that is applied in any recursive function is known as base condition. A base condition is must in every recursive function otherwise it will continue to execute like an infinite loop.

Working Principle:

  1. Recursive function is called by some external code.
  2. If the base condition is met then the program gives meaningful output and exits.
  3. Otherwise, function does some required processing and then calls itself to continue recursion. Here is an example of recursive function used to calculate factorial.

Example:
def fact (n):
if n = = 0:
return 1
else:
return n * fact (n – 1)
print (fact (0))
print (fact (5))
Output:
1
120

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

12th Computer Science Guide Python Functions Additional Questions and Answers

I. Choose the best answer

Question 1.
The name of the function is followed by ………………………….
(a) ( )
(b) [ ]
(c) <>
(d) { }
Answer:
(a) ( )

Question 2.
Which of the following provides better modularity for your python application
a) tuples
b) function
c) dictionaries
d) control structures
Answer:
b) function.

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 3.
How many types of functions are there in python?
a) 3
b) 2
c) 4
d) 5
Answer:
c) 4

Question 4.
Functions that call itself are known as
a) User-defined
b) Built-in
c) Recursive
d) Lambda
Answer:
c) Recursive

Question 5.
If the return has no argument, …………………………….. will be displayed as the last statement of the output.
(a) No
(b) None
(c) Nothing
(d) No value
Answer:
(b) None

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 6.
In which of the following the number of arguments in the function call should match exactly with the function definition?
a) Keyword arguments
b) Required arguments
c) Default arguments
d) Variable-length arguments
Answer:
b) Required arguments

Question 7.
Which of the following is used to define variable-length arguments?
a) $
b) *
c) #
d) //
Answer:
b) *

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 8.
What is the symbol used to denote variable-length arguments?
(a) +
(b) *
(c) &
(d) ++
Answer:
(b) *

Question 9.
Which function can take any number of arguments and must return one value in the form of an expression?
a) user-defined
b) recursive
c) default
d) lambda
Answer:
d) lambda

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 10.
How many return statement is executed at runtime?
a) 2
b) multiple
c) 3
d) 1
Answer:
d) 1

Question 11.
How many types of scopes in Python?
a) 3
b) 4
c) many
d) 2
Answer:
d) 2

Question 12.
Lambda functions cannot be used in combination with ………………………….
(a) Filter
(b) Map
(c) Print
(d) Reduce
Answer:
(c) Print

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 13.
Function blocks begin with the keyword …………………
a) Fun
b) Definition
c) Function
d) Def
Answer:
d) Def

Question 14.
………………. function can only access global variables.
a) user-defined
b) recursive
c) Lambda
d) return
Answer:
c) Lambda

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 15.
Find the correct one:
(a) Global keyword outside the function has no effect
(b) Global keyword outside the function has an effect
Answer:
(a) Global keyword outside the function has no effect

II. Answer the following questions (2 and 3 Marks)

Question 1.
Define nested blocks?
Answer:
Nested Block:
A block within a block is called a nested block. When the first block statement is indented by a single tab space, the second block of statement is indented by double tab spaces.

Question 2.
Differentiate parameters and arguments.
Answer:

Parameters

Arguments

Parameters are the variables used in the function definition. Arguments are the values we pass to the function parameters.

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 3.
Differentiate parameters and arguments?
Answer:
Parameters are the variables used in the function definition whereas arguments are the values we pass to the function parameters.

Question 4.
Write the syntax of variable-length arguments.
Answer:
def function_name(*args):
function_body
return_statement

Question 5.
What are the methods used to parse the arguments to the variable length arguments?
Answer:
In Variable Length arguments, we can parse the arguments using two methods.

  • Non-keyword variable arguments
  • Keyword variable arguments

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 6.
What is a local variable?
Answer:
A variable declared inside the function’s body or in the local scope is known as a local variable.

Question 7.
What are the two methods of passing arguments in variable-length arguments?
Answer:
In Variable Length arguments, we can pass the arguments using two methods.

  1. Non-keyword variable arguments
  2. Keyword variable arguments

Question 8.
Write a note on return statement?
Answer:
The return Statement

  1. The return statement causes your function to exit and returns a value to its caller. The point of functions in general is to take inputs and return something.
  2. The return statement is used when a function is ready to return a value to its caller. So, only one return statement is executed at run time even though the function contains multiple return statements.
  3. Any number of ‘return’ statements are allowed in a function definition but only one of them is executed at run time.

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 9.
Write a note on min (), max () and sum () with an example
Answer:
Function: min ()
Description: Returns the minimum value in a list.
Syntax: min (list)
Example:
My List = [21,76,98,23]
print (‘Minimum of My List:’,
min(My List))
Output:
Minimum of My List: 21
Function.: max ()
Description:
Returns the maximum value in a list.
Syntax : min (list)
Example:
My List = [21,76,98,23]
print (‘maximum of My List :‘, max
(my list)
Output:
Maximum of My List: 98
Function : sum ()
Description:
Returns the sum of values in a list.
Syntax :sum (list)
Example:
My List = [21,76,98,23]
print (Sum of My List :‘, sum(My List))
Output:
Sum of My List :218

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 10.
Write a note on the floor, cell () and sqrt () with an example
Answer:
Function: floor ()
Description: Returns the largest integer
less than or equal to x.
Syntax: math.floor (x)
Example:
x=26.7
y=-26.7
print (math.floor (x))
print (math.floor (y))
Output:
26
-27
Function: ceil ()
Description: Returns the smallest integer greater than or equal to x.
Syntax: math.ceil (x)
Example:
x=26.7
y=-26.7
print (math.ceil (x))
print (math.ceil (y))
Output:
27
-26 . ‘
Function : sqrt ()
Description: Returns the square root of x (Note: x must be greater than zero) Syntax: sqrt (x)
Example:
a=49
b= 25
print (math.sqrt (a))
print (math.sqrt (b))
Output:
7.0
5.0

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

Question 11.
Write a note on the format () with an example.
Answer:
Function: format ()
Description:
Returns the output based on the given format.

  • Binary format: Outputs the number in base 2.
  • Octal format: Outputs the number in base 8.
  • Fixed-point notation: Displays the number as a fixed-point number. The default precision is 6.

Syntax : format (value [‚format_spec])
Example:
x=14
y=25
print (‘x value in binary :’,format(x/b’))
print (‘y value in octal ^formatfy/o’))
print(‘y value in Fixed-point no ‘,format(y/f’))
Output:
x value in binary: 1110
y value in octal: 31
y value in Fixed-point no : 25.000000

Samacheer Kalvi 12th Computer Science Guide Chapter 7 Python Functions

III. Answer the following questions (5 Marks)

Question 1.
Explain different types of arguments used in python with an example.
Answer:

  • Arguments are used to call a function.
  • There are primarily four types of functions namely:
    1. Required arguments
    2. Keyword arguments,
    3. Default arguments
    4. Variable-length arguments.

Required Arguments:

  • “Required Arguments” are the arguments passed to a function in correct positional order.
  • The number of arguments in the function call should match exactly with the function definition.
  • Atleast one parameter to prevent syntax errors to get the required output.

Example:
defprintstring(str):
print (“Example – Required arguments”)
print (str)
return
# Now you can call printstring() function
printstring (“Welcome”)

Output:
Example – Required arguments Welcome
When the above code is executed, it
produces the following error.
Traceback (most recent call last):
File “Req-arg.py”, line 10, in < module >
printstring()
TypeError: printstring() missing 1
required positional argument: ‘str’
Instead of printstring() in the above code if we use printstring (“Welcome”) then the output is
Output:
Example – Required arguments Welcome

Keyword Arguments:

  • Keyword arguments will invoke the function after the parameters are recognized by their parameter names.
  • The value of the keyword argument is matched with the parameter name and so, one can also put arguments in improper order (not in order).

Example:
def printdata (name):
print (“Example-1 Keyword arguments”)
print (“Name : “:name)
return
# Now you can call printdatat() function
print data(name = “Gshan”) When the above code is executed, it produces the following output:

Output:
Example-1 Keyword arguments
Name: Gshan
Default Arguments:

  • In Python the default argument is an argument that takes a default value if no value is provided in the function call.
  • The following example uses default arguments, that prints default salary when no argument is passed.

Example:
def printinfo( name, salary = 3500):
print (“Name:”, name)
print (“Salary: “, salary)
return
printinfo(“Mani”)
When the above code is executed, it produces the following output

Output:
Name: Mani
Salary: 3500
When the above code is changed as print info(“Ram,”:2000) it produces the following

Output:
Name: Ram
Salary: 2000

Variable-Length Arguments:

  • In some instances, it is needed to pass more arguments that have already been specified.
  • These arguments are not specified in the function’s definition and an asterisk (*) is used to define such arguments.
  • These types of arguments are called Variable-Length arguments.

Syntax:
def function_name(*args):
function_body
return_statement

Example:
def printnos (*nos):
for n in nos:
print(n)
return
# now invoking the printnos() function
print (‘Printing two values’)
printnos (1,2)
Print (‘Printing three values’)
printnos (10,20,30)

Output:
Printing two values
1
2
Printing three values
10
20
30

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Computer Science Guide Pdf Chapter 8 Strings and String Manipulations Text Book Back Questions and Answers, Notes.

Tamilnadu Samacheer Kalvi 12th Computer Science Solutions Chapter 8 Strings and String Manipulations

12th Computer Science Guide Strings and String Manipulations Text Book Questions and Answers

I. Choose the best answer (1 Marks)

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 1.
Which of the following is the output of the following python code?
str1=”TamilNadu”
print(strl[::-1])
a) Tamilnadu
b) Tmlau
c) udanlimaT
d) udaNlimaT
Answer:
d) udaNlimaT

Question 2.
What will be the output of the following code?
str1 = “Chennai Schools”
str1[7] =
a) Chennai-Schools
b) Chenna-School
c) Type error
d) Chennai
Answer:
a) Chennai-Schools

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 3.
Which of the following operator is used for concatenation?
a) +
b) &
c) *
d) =
Answer:
a) +

Question 4.
Defining strings within triple quotes allows creating:
a) Single line Strings
b) Multiline Strings
c) Double line Strings
d) Multiple Strings
Answer:
b) Multiline Strings

Question 5.
Strings in python:
a) Changeable
b) Mutable
c) Immutable
d) flexible
Answer:
c) Immutable

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 6.
Which of the following is the slicing operator?
a) {}
b) []
c) <>
d) ()
Answer:
b) [ ]

Question 7.
What is stride?
a) index value of slide operation
b) first argument of slice operation
c) the second argument of slice operation
d) third argument of slice operation
Answer:
d) third argument of slice operation

Question 8.
Which of the following formatting character is used to print exponential notation in the upper case?
a) %e
b) %E
c) %g
d) %n
Answer:
a) %e

Question 9.
Which of the following is used as placeholders or replacement fields which get replaced along with the format() function?
a) {}
b) <>
c) ++
d) ^^
Answer:
a) {}

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 10.
The subscript of a string may be:
a) Positive
b) Negative
c) Both (a) and (b)
d) Either (a) or (b)
Answer:
d) Either (a) or (b)

II. Answer the following questions (2 Marks)

Question 1.
What is String?
Answer:
String is a data type in python, which is used to handle array of characters. String is a sequence of Unicode characters that may be a combination of letters, numbers, or special symbols enclosed within single, double or even triple quotes.
Example:
‘Welcome to learning Python’
“Welcome to learning Python”
“Welcome to learning Python”

Question 2.
Do you modify a string in Python?
Answer:

  • No, because strings in python are immutable.
  • That means once you define a string, modifications or deletion is not allowed.
  • If we want to modify the string, a new string value can be assigned to the existing string variable.

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 3.
How will you delete a string in Python?
Answer:
Python will not allow deleting a particular character in a string. Whereas you can remove the entire string variable using the del command.
Example: Code lines to delete a string variable
>>> str1=”How about you”
>>> print (str1)
How about you
>>> del str1
>>> print (str1)
NameError: name ‘str1’ is not defined

Question 4.
What will be the output of the following python code?
str1= “School”
print(str1*3)
Output:
School School School

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 5.
What is slicing?
Answer:
String slicing:
Slice is a substring of a main string. A substring can be taken from the original string by using [ ] operator and index or subscript values. Thus, [ ] is also known as slicing operator. Using slice operator, we can slice one or more substrings from a main string.

General format of slice operation:
str[start:end]
Where start is the beginning index and end is the last index value of a character in the string. Python takes the end value less than one from the actual index specified. For example, if you want to slice first 4 characters from a string, you have to specify it as 0 to 5. Because python considers only the end value as n – 1.
Example: slice a single character from a string
>>> str1=”THIRUKKURAL”
>>> print (str1[0])
T

III. Answer the following questions (3 Marks)

Question 1.
Write a Python program to display the given pattern
C O M P U T E R
C O M P U T E
C O M P U T
C O M P U
C O M P
C O M
C O
C
Coding:
str 1=” COMPUTER”
index=len(str1)
for i in str1:
print(strl[0:index])
index-=1
Output:
>>>
RESTART: C:/Users/COMPUTER/
AppData/Local/Programs/Python/ Python37-32/compl.py ‘
COMPUTER
COMPUTE
COMPUT
COMPU
COMP
COM
CO
C

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 2.
Write a short note about the following with suitable example:
(a) capitalize()
(b) swapcase()
Answer:
(a) Function: capitalize()
Syntax: capitalize ()
Description: Used to capitalize the first character of the string

Example:
>>>city=”chennai”
>>>print(city. capitalize())
Chennai

Function: swapcase ()
Syntax: It will change case of every ‘ character to its opposite case vice-versa.
Description:

Example:
>>>strl=”tAmil.NaDu”
>>>print (str1. swapcase ())
TaMIlnAdU

Question 3.
What will be the output of the given python program?
str1 = “welcome”
str2 = “to school”
str3=str1[:2]+str2[len(str2)-2:] print(str3)
Output:
>>>
RESTART: C:/Users/COMPUTER/
AppData/Local/Programs/Python/ Python37-32/ compl.py
weol
>>>

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 4.
What is the use of format()? Give an example.
Answer:
The format( ) function used with strings is very versatile and powerful function used for formatting strings. The curly braces { } are used as placeholders or replacement fields which get replaced along with format( ) function.
Example:
num1 = int (input (“Number 1: “))
num2 = int (input (“Number 2: “))
print (“The sum of { } and { } is { }”.format (num1, num2,(num1 + num2)))
OutPut:
Number 1 : 34
Number 2 : 54
The sum of 34 and 54 is 88.

Question 5.
Write a note about count( ) function in python.
Answer:
Function: count()
Syntax: count (str, beg, end)

Description:

  • Returns the number of substrings occurs within the given range.
  • Substring may be a single character.
  • Range (beg and end) arguments are optional. If it is not given, python searched in whole string.
  • Search is case sensitive.

Example:
>>>strl=” Raja RajaChozhan >>> print(strl.count(/Raja’))
2
>>>print(strl.count(‘r’))
0
>>>print(strl.count(‘R’))
2
>>>prin(strl.count(‘a’))
5
>>>print (strl.count(‘a’,0.5))
2
>>>prin(strl.count(/a’,11))
1

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

IV. Answer the following questions (5 Marks)

Question 1.
Explain string operators in python with suitable examples.
Answer:
String Operators:
Python provides the following operators for string operations. These operators are useful to manipulate strings.

(i) Concatenation (+):
The joining of two or more strings is called Concatenation. The plus (+) operator is used to concatenate strings in python.
Example:
>>> “welcome” + “Python”
‘welcomePython’

(ii) Append (+=):
Adding more strings at the end of an existing string is known as append. The operator += is used to append a new string with an existing string.
Example:
>>> str1 =”Welcome to ”
>>> str1+=”Leam Python”
>>> print (str1)
Welcome to Learn Python

(iii) Repeating (*):
The multiplication operator (*) is used to display a string in multiple times.
Example:
>>> str1 =”Welcome”
>>> print (str1*4)
Welcome Welcome Welcome Welcome

(iv) String slicing:
A slice is a substring of the main string. A substring can be taken from the original string by using [ ] operator and index or subscript values. Thus, [ ] is also known as the slicing operator. Using the slice operator, you have to slice one or more substrings from the main string.
The general format of slice operation:
str[start: end]
Where start is the beginning index and end is the last index value of a character in the string. Python takes the end value less than one from the actual index specified. For example, if you want to slice the first 4 characters from a string, you have to specify it as 0 to 5. Because python considers only the end value as n – 1.
Example:
(i) slice a single character from a string
>>> str1=”THIRUKKURAL ”
>>> print (str1 [0])
T.

(v) Stride when slicing string
When the slicing operation, you can specify a third argument as the stride, which refers to the number of characters to move forward after the first character is retrieved from the string. The default value of stride is 1.
Example:
>>> str1= “Welcome to learn Python”
>>> print (str1 [10:16])
learn
Note: Remember that, python takes the last value as n – 1
You can also use negative value as stride (third argument). If you specify a negative value, it prints in reverse order.
Example:
>>> str1 = “Welcome to learn Python”
>>> print(str1 [::-2])
nhy re teoIW

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

12th Computer Science Guide Chapter 8 Strings and String Manipulations Important Questions and Answers

I. Choose the best answer (1 Mark)

Question 1.
Strings in Python can be created using ………………………….. quotes
(a) Single
(b) Double
(c) Triple
(d) All the above
Answer:
(d) All the above

Question 2.
Strings are enclosed with
a) ”
b) ” ”
c) ”’ ”’
d) all of these
Answer:
d) all of these

Question 3.
The positive subscript of the string starts from ………………………….. and ends with …………………………
Answer:
0, n – 1

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 4.
Another name of String index values are
a) class
b) subscript
c) function
d) arguments
Answer:
b) subscript

Question 5.
…………… is used to access and manipulate the strings
a) Index value
b) Subscript
c) Parameters
d) a or b
Answer:
d) a or b

Question 6.
Which function is used to change all occurrences of a particular character in a string?
(a) Replace ( )
(b) Change ( )
(c) Edit ( )
(d) Append ( )
Answer:
(a) Replace ( )

Question 7.
The negative subscript is always begun with
a) 0
b) -1
c) 1
d) -1.0
Answer:
b) -1

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 8.
Which of the following operators are useful to do string manipulation?
a) +, –
b) *,/
c) + *
d) ; ”
Answer:
c) + *

Question 9.
Adding more strings at the end of existing strings is ………………………….
(a) Append
(b) Concatenation
(c) Repeating
(d) Slicing
Answer:
(a) Append

Question 10.
Python provides a function to change all occurrences of a particular character in a string.
a) replace()
b) change ()
c) change all ()
d) repalce all ()
Answer:
a) replace()

Question 11.
The operator is used to append a new string with an existing string.
a) +
b) + =
c) * =
d) + +
Answer:
b) + =

Question 12.
The operator is used to display a string multiple times.
a) *
b) * *
c) * =
d) + +
Answer:
a) *

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 13.
Escape sequences starts with a
a) /
b) \
c) //
d) \”
Answer:
b) \

Question 14.
In python, the end value is considered as ……………………….
(a) 0
(b) n
(c) n – 1
(d) 1
Answer:
(c) n – 1

Question 15.
The ……………. function is a powerful function used for formatting strings.
a) format ()
b) string ()
c) Slice ()
d) format string ()
Answer:
a) format ()

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 16.
Formatting operator which is used to represent signed decimal integer.
a) %d or %i
b) %s or %c
c) %g or %x
d) % s or %e
Answer:
a) %d or %i

II. Answer the following questions (2 and 3 Marks)

Question 1.
Write the general format of slice operation.
Answer:
General format of slice operation: str[start:end]
Start is the beginning index and End is the last index value of a character in the string.
Python takes the end value less than one from the actual index specified.

Question 2.
What is meant by stride?
Answer:

  • A slice is a substring of the main string.
  • Stride is a third argument in the slicing operation which refers to the number of characters to move forward after the first character is retrieved from the string.
  • The default value of stride is 1.

Example:
>>> strl = “Welcome to learn Python”
>>>print(str1[::-2])
Output:
nhy re teolW

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 3.
Write a note on Append Operator?
Answer:
Append (+=)
Adding more strings at the end of an existing string is known as append.
The operator += is used to append a new string with an existing string.
Example:
>>> str1=’Welcome to ”
>>> str1+=”Leam Python”
>>> print (str1)
Welcome to Learn Python

Question 4.
What is the use of find () function? Explain with an example.
Answer:
Function: find ()
Syntax:
find(sub[,start[, end]])
Description:

  • The function is used to search the first occurrence of the substring in the given string.
  • It returns the index at which the substring starts.
  • It returns -1 if the substring does not occur in the string.

Example:
>>> strl=’mammals’
>>> strl.find(‘ma’)
0
On omitting the start  parameters, the function  starts the search from the  beginning.
>>> str1.find(/ma/2)
3
>>> str1.find(‘ma’,2,4)
-1
Displays -1 because the substring could not be found between the index 2 and 4-1

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 5.
Write a note on lower () and is lower () functions.
Answer:
Function lower ()
Syntax:
lower ()

Description:
Returns the exact copy of the string with all the letters in lowercase
Example:

>>> strl=’SAVE EARTH’
>>>print(strl.lower())
save earth

Function :islower()
Syntax:
islower()

Description:
Returns True if the string is in lowercase
Example:
>>>str1=’welcome’
>>> print (strl.islower())
True

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 6.
Differentiate upper () and isupper ().
Answer:

upper () isupper ()
Function :upper()
Syntax: ‘upper()
Description:
Returns the exact copy of the string with all letters in uppercase
Example:
>>>str1=’welcome’
>>>print(str.upper())
WELCOME
Function: isupper()
Syntax:
isupper()
Description:
Returns True if the string is in uppercase.
Example:
>>>strl=’welcome’
>>>pr int (strl. isupper())
False

Question 7.
What will be the output of the given Python program?
Answer:
str=”COMPUTER SCIENCE”
(a) print(str*2)
(b) print{str[0: 7])
Output:
Str=” COMPUTER SCIENCE”
i) print(str*2) → COMPUTER SCIENCE
COMPUTER SCIENCE
ii) print(str[0 : 7])→ COMPUTE

Question 8.
Write notes on (a) isalnum (),
(b) isalpha () and (c) isdigit ()
Answer:
Function: isalnum ()
Syntax: isalnum ()

Description:

  • Returns True if the string contains only letters and digits. It returns False.
  • If the string contains any special character like *, etc.

Example1:
>>>str1=’Save Earth’
>>>str1. isalnum()
False
The function returns False as space is an alphanumeric character.

Example 2:
>>>strl=,savelEarth’.
>>>isalnum()
True

Function: isalpha()
Syntax: isalpha ()
Description:
Returns True if the string contains only letters Otherwise return False.

Example:
>>> str1=’SaveiEarth’
>>>str1.isalpha()
False
>>> str1-‘SaveEarth’
>>>str1 .isalpha ()
True
>>>
Function: isdigit ()
Syntax: isdigit ()

Description:
Returns True if the string contains only numbers. Otherwise it returns False

Example 1:
>>>str1=’SavelEarth’
>>>str1.isdigit()
False

Example 2:
>>> str1=’12345′
>>>str1.isdigit()
True
>>>

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 9.
Write notes on Formatting Characters
Answer:

Format Characters Usage
%c Character
%d (or) %i Signed decimal integer
%s String
%u Unsigned decimal integer
%0 Octal integer
%x or %X Hexadecimal integer (lower case x refers a-f; upper case X refers A-F)
%e or %E Exponential notation
%f Floating point numbers
%g or %G Short numbers in floating-point or exponential notation.

Question 10.
Give the general format of replace function.
replace(“char1”, “char2″)
The replace function replaces all occurrences of charl with char2.

Example:
>>> str1=”How are you”
>>> print (strl)
How are you
>>>print (str1.replace(“o”, “e”))
Hew are yeu

Question 11.
Write a note on Escape Sequence in Python
Answer:

Escape Sequence Description
\ newline Backslash and newline ignored
\\ Backslash
\’ Single quote
\” Double quote
\a ASCII Bell
\b ASCII Backspace
\f ASCII Form feed
\n ASCII Linefeed
\r ASCII Carriage Return
\t ASCII Horizontal Tab
\v ASCII Vertical Tab
\ooo A character with an octal value 000
\xHH A character with hexadecimal value HH

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 12.
What will be the output of the following Python code?
Strl = “Madurai”
print(Strl*3)
Output:
Madurai Madurai Madurai

Question 13.
What will be output of the following Python snippet?
strl=” THOLK APPIY AM” print(strl[4:])
print(strl[4::2])
print(strl[::3])
print(strl[::-3])
Output:
Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations 1

Question 14.
What will be the output of the following python program?
str1 = “welcome”
str2 = “to school”
str3 = strl[:3]+str2[len(str2)-1:] print(str3)
Output: Well

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

III. Answer the following questions (5 Marks)

Question 1.
Write a python program to check whether the given string is palindrome or not.
Answer:
str1 = input (“Enter a string:”)
str2 =”
index=-1
for i in strl:
str2 += str1 [index]
index -=1
print (“The given string = {} \n The Reversed string = {}”.format(strl, str2)) if (strl==str2):
print (“Hence, the given string is Palindrome”)
else:
print (“Hence, the given is not a palindrome”)

Question 2.
Write a python program to display the number of vowels and consonants in the given string.
Answer:
str1=input (“Enter a string:”)
str2=” a AeEiloOuU”
v,c=0,0
for i in str1:
if i in str2: .
v+=1
else:
c+=1
print (“The given string contains {} vowels and {} consonants.format(v.c))

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 3.
Explain how the positive and negative subscript values are assigned? Give example.
Answer:
The positive subscript 0 is assigned to the first character and n-1 to the last character, where n is the number of characters in the string. The negative index assigned from the last character to the first character in reverse order begins with -1.

String S C H O O L
Positive subscript 0 1 2 3 4 5
Built-in functions -6 -5 -4 -3 -2 -1

Question 4.
Explain “Membership Operators suitable example.
Answer:

  • The ‘in’ and ‘not in’ operators can be used with strings to determine whether a string is present in another string.
  • Therefore, these operators are called Membership Operators.

Example:
strl=input (“Enter a string:”)
str2=” Chennai”
if str2 in str1:
print (“Found”)
else:
print (“Not Found”)

Output:1
Enter a string: Chennai GHSS, Saidapet Found
Output:2
Enter a string: Govt GHSS, Ashok Nagar Not Found

Question 5.
Write the output for the following Python commands: str1=”Welcome to Python”
(i) print(strl) (ii) print(strl[ll: 17])
(iii) print(strl[ll: 17 : 2])
(iv) print(strl[:: 4])
(v) print(strl[:: -4])
Output:
>>> strl=” Welcome to Python’
>>> print(strl)
Welcome to Python
>>> print(strl[ll: 17])
Python
>>> print(strl[ll: 17 : 2])
Pto
>>> print(strl[:: 4])
Wotyn
>>> print(strl[:: -4])
nytoW

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 6.
Write a program to accept a string and print it in reverse order.
Answer:
Coding:
strl = input (“Enter a string:”)
Index=-1
while index > = -(lentstrll)):
print (“Subscript”,index,”] :”
+ strl [index])
index +=-1
Output:
Enter a string: welcome Subscript [ -1 ]: e
Subscript [ -2 ]: m
Subscript [ -3 ]: 0
Subscript [ -4 ]: c
Subscript [-5]: 1
Subscript [ -6 ] : e
Subscript [ -7 ] :w

Samacheer Kalvi 12th Computer Science Guide Chapter 8 Strings and String Manipulations

Question 7.
Write a simple python program with list of five marks and print the sum of all the marks using while loop.
Answer:
Python Program:
mark-[]
for x in range(0,5): num=int(input(“Enter Mark:”))
mark+=(num,)
print(mark)
c=len(mark)
i=0
sum=0
while i<c:
sum+=mark[i]
i+=1
print(” Sum=” ,sum)
Output:
Enter Mark:60
Enter Mark:70
Enter Mark:80
Enter Mark:90
Enter Mark:100
[60, 70,80, 90,100]
Sum= 400

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Computer Science Guide Pdf Chapter 9 Lists, Tuples, Sets and Dictionary Text Book Back Questions and Answers, Notes.

Tamilnadu Samacheer Kalvi 12th Computer Science Solutions Chapter 9 Lists, Tuples, Sets and Dictionary

12th Computer Science Guide Lists, Tuples, Sets and Dictionary Text Book Questions and Answers

I. Choose the best answer (1 Marks)

Question 1.
Pick odd one in connection with collection data type
a) List
b) Tuple
c) Dictionary
d) Loop
Answer:
d) Loop

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 2.
Let list l=[2,4,6,8,10], then print(Listl[-2]) will result in
a) 10
b) 8
c) 4
d) 6
Answer:
b) 8

Question 3.
Which of the following function is used to count the number of elements in a list?
a) count()
b) find()
c) len()
d) index()
Answer:
c) len()

Question 4.
If List= [10,20,30,40,50] then List[2]=35 will result ~
a) [35,10,20,30,40,50]
b) [10,20,30,40,50,35]
c) [10,20,35,40,50)
d) [10,35,30,40,50]
Answer:
c) [10,20,35,40,50]

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 5.
If List= [17,23,41,10] then List.append (32) will result
a) [32,17,23,41,10]
b) [17,23,41,10,32]
c) [10,17,23,32,41]
d) [41,32,23,17,10]
Answer:
b) [17,23,41,10,32]

Question 6.
Which of the following Python function can be used to add more than one element within an existing list?
a) append ()
b) append_more()
c) extend ()
d) more()
Answer:
c) extend()

Question 7.
What will be the result of the following Python code?
S=[x**2 for x in range(5)]
print(S)
a) [0,1,2,4,5]
b) [0,1,4,9,16]
c) [0,1,4,9,16,25]
d) [1,4,9,16,25]
Answer:
b) [0,1,4,9,16]

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 8.
What is the use of type() function in python?
a) To create a Tuple
b) To know the type of an element in the tuple
c) To know the data type of python object
d) To create a list.
Answer:
c) To know the data type of python object

Question 9.
Which of the following statement is not correct?
a) A list is mutable
b) A tuple is immutable.
c) The append () function is used to add an element.
d) The extend () function is used in tuple to add elements in a list.
Answer:
d) The extend() function is used in tuple to add elements in a list.

Question 10.
Let setA={3,6,9], setB={l,3,9}. What will be the result of the following snippet? print(setA | setB)
a) {3,6,9,1,3,9}
b) {3,9} c) {1}
c) {1}
d) {1,3,6,9}
Answer:
d) [1,3,6,9}

Question 11.
Which of the following set operation includes all the elements that are in two sets but not the one that are common to two sets?
a) Symmetric difference
b) Difference
c) Intersection
d) Union
Answer:
a) Symmetric difference

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 12.
The keys in Python, the dictionary is specified by
a) =
b) ;
c) +
d) :
Answer:
d) :

II. Answer the following questions (2 Marks)

Question 1.
What is List in Python?
Answer:
A list in Python is known as a “sequence data type” like strings. It is an ordered collection of values enclosed within square brackets [ ]. Each value of a list is called an element.

Question 2.
How will you access the list elements in reverse order?
Answer:

  • Python enables reverse or negative indexing for the list elements.
  • Thus, python lists index in the opposite order.
  • The python sets -1 as the index value for the last element in the list and -2 for the preceding element and so on. This is called Reverse Indexing.

Example: Age = [15,20,29,45,60]

Age 15 20 29 45 60
Positive index 0 1 2 3 4
Negative index -5 -4 -3 -2 -1

Question 3.
What will be the value of x in the following python code?
Answer:
List1=[2, 4, 6, [1, 3, 5]]
x=len(List1)
Ans: 4

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 4.
Differentiate del with remove() the function of List.
Answer:

del statement remove () function
1. del is a statement used to delete the known elements of a list remove() the function is used to delete elements of a list if its index is unknown.
2. The del command can also be used to delete the entire list. The remove () function can be used to delete one or more elements if the index value is not known.

Question 5.
Write the syntax of creating a Tuple with n number of elements.
Answer:
# Tuple with n number elements
Tuple _ Name = (E1, E2, E2 ……………… En)
# Elements of a tuple without parenthesis
Tuple_Name = E1, E2, E3 …………………. En

Question 6.
What is set in Python?
Answer:

  • Set is another type of collection data type.
  • A Set is a mutable and unordered collection of elements without duplicates.

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

III. Answer the following questions (3 Marks)

Question 1.
What are the advantages of Tuples over a list?
Answer:

  • The elements of a list are changeable (mutable) whereas the elements of a tuple are unchangeable (immutable), this is the key difference between tuples and list.
  • The elements of a list are enclosed within square brackets. But, the elements of a tuple are enclosed by parentheses.
  • Iterating tuples is faster than a list.

Question 2.
Write a shot note about sort().
Answer:
Function : Sort ()
Syntax:
List.sort( reverse=True | False, key=my Func)

  • Both arguments are optional.
  • If reverse is set as True, list sorting is in descending order.
  • Ascending is default.

Description:
Sort () function sorts the element in list

Example:
MyList=[‘Thilothamma’, ‘Tharani’, ‘Anitha’, ‘SaiSree’, ‘Lavanya’]
MyList.sort()
print(MyList)
MyList.sort(reverse=True)
print(MyList)
Output:
[‘Anitha’, ‘Lavanya’, ‘SaiSree’, ‘Tharani’, ‘Thilothamma’]
[‘Thilothamma’, ‘Tharani’, ‘SaiSree’, ‘Lavanya’, ‘Anitha’]

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 3.
What will be the output of the following code?
list = [2**x for x in range(5)] print(list)
Output:
[1,2,4,8,16]

Question 4.
Explain the difference between del and clear() in the dictionary with an example.
Answer:

del clear()
1. del keyword is used to delete a particular element of a dictionary The clear() function is used to delete all the elements in a dictionary
2. del keyword can be used to remove the dictionary The clear() function is used to delete all the elements in a dictionary not a dictionary structure.
3. Example: del Dict[‘MarkT] del Diet Example: Dict.clear()

Question 5.
List out the set operations supported by python.
Answer:
The python supports the set operations such as
Union, Intersection, Difference, and Symmetric difference.

Union:

  • The union includes all elements from two or more sets.
  • In python, the operator | (pipeline) is used to the union of two) sets.
  • The function union() is also used to join two sets in python.

Intersection:

  • Intersection includes the common elements in two sets.
  • The operator & is used to intersect two sets in python.
  • The function intersection() is also used to intersect two sets in python.

Difference:

  • The difference includes all elements that are in the first set (say set A) but not in the second set (say set B).
  • The minus (-) operator is used to difference set operation in python.
  • The function difference() is also used to difference operation.

Symmetric difference:

  • The symmetric difference includes all the elements that are in two sets (say sets A and B) but not the one that are common to two sets.
  • The caret (A) operator is used to symmetric difference set operation in python.
  • The function symmetric_difference() is also used to do the same operation.

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 6.
What are the differences between List and Dictionary?
Answer:

List Dictionary
List is an ordered set of elements Dictionary is a data structure that is used for matching one element (Key) with another (Value).
The index values can be used to access a particular element. In dictionary, key represents an index and key may be a number of a string.
Lists are used to look up a value Dictionary is used to take one value and look up another value.

IV. Answer the following questions (5 Marks)

Question 1.
What the different ways to insert an element in a list. Explain with suitable example.
Answer:
append( ) function in Python is used to add more elements to a list. But, it includes elements at the end of a list. If you want to include an element at your desired position, you can use the insert () function is used to insert an element at any position of a list.
Syntax:
List, insert (position index, element)
Example:
>>> MyList=[34,98,47, ‘Kannan’, ‘Gowrisankar’, ‘Lenin’, ‘Sreenivasan’ ]
>>> print(MyList)
[34, 98, 47, ‘Kannan’, ‘Gowrisankar’, ‘Lenin’, ‘Sreenivasan’]
>>> MyList.insert(3, ‘Ramakrishnan’)
>>> print(MyList)
[34, 98, 47, ‘Ramakrishnan’, ‘Kannan’, ‘Gowrisankar’, ‘Lenin’, ‘Sreenivasan’]
In the above example, insertf) function inserts a new element ‘Ramakrishnan’ at the index value 3, ie. at the 4th position. While inserting a new element in between the existing elements, at a particular location, the existing elements shifts one position to the right.

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 2.
What is the purpose of range()? Explain with an example.
Answer:
(i) The range( ) is a function used to generate a series of values in Python. Using the range( ) function, you can create list with series of values. The range( ) function has three arguments.
Syntax of range( ) function:
range (start value, end value, step value)
where,

  • start value – beginning value of series. Zero is the default beginning value.
  • end value – the upper limit of series. Python takes the ending value as upper limit – 1.
  • step value – It is an optional argument, which is used to generate different intervals of values.

Example: Generating whole numbers upto 10
for x in range (1, 11):
print(x)
Output
1
2
3
4
5
6
7
8
9
10

(ii) Creating a list with series of values
Using the range( ) function, you can create a list with series of values. To convert the result of range( ) function into list, we need one more function called list( ). The list( ) function makes the result of range( ) as a list.
Syntax:
List_Varibale = list ( range ( ) )
Note
The list( ) function is all so used to create list in python.
Example
>>> Even_List = list(range(2,11,2))
>>> print(Even_List)
[2, 4, 6, 8, 10]
In the above code, list( ) function takes the result of range( ) as Even List elements. Thus, Even _List list has the elements of first five even numbers.

(iii) We can create any series of values using the range( ) function. The following example explains how to create a list with squares of the first 10 natural numbers.
Example: Generating squares of first 10 natural numbers
squares = [ ]
for x in range(1,11):
s = x ** 2
squares.append(s)
print (squares)
Output
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]

Question 3.
What is a nested tuple? Explain with an example.’
Answer:

  • In Python, a tuple can be defined inside another tuple; called a Nested tuple.
  • In a nested tuple, each tuple is considered as an element.
  • The for loop will be useful to access all the elements in a nested tuple.

Example:
Toppers = ((“Vinodini”, “XII-P”, 98.7),
Ç’Soundarya”, “XII-H”, 97.5),
(“Tharani”, “XII-P”, 95.3),
(“Saisri”, “XII-G”, 93.8))
for j in Toppers:
print(i)
Output:
(Vinodini’, ‘XII-F’, 98.7)
(Soundarya’, ‘XII-H’, 97.5)
(Tharani’, ‘XII-F’, 95.3)
(‘Saisri’, ‘XII-G’, 93.8)

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 4.
Explain the different supported by python example.
Answer:
The python supports the set operations such as
Union, Intersection, difference and Symmetric difference.

Union:

  • Union includes all elements from two or more sets.
  • In python, the operator | (pipe line) is used to union of two sets.
  • The function union( ) is also used to join two sets in python.

Example:
Program to Join (Union) two sets using union operator and union function
set_A={2,4,6,8}
set_B={‘A’, ‘B’, ‘C’, ‘D’}
U_set=set_A 1 set_B
print(U _set)
set_ U=set_ A.union(set_ B)
Output:
{2,4,6,8,’A’,’DVC’,’B’}
{‘D’, 2,4, 6,8,’B’,’C’,’A’}

Intersection:

  • Intersection includes the common elements in two sets.
  • The operator & is used to intersect two sets in python.
  • The function intersection() is also used to intersect two sets in python.

Example:
Program to insect two sets using intersection operator and intersection function
set_A={‘A’, 2,4, ‘D’}
set_B={‘A’, ‘B’, ‘C, ‘D’}
print(set_A&set_B)
print( set_A.intersection( set_B)
output:
{‘A’, ‘D’}
{‘A’/D’}

Difference:

  • Difference includes all elements that are in first set (say set A) but not in the second set (say set B).
  • The minus (-) operator is used to difference set operation in python.
  • The function difference() is also used to difference operation.

Example:
Program to difference of two sets using minus operator and difference function
set_A={‘A’, 2,4, ‘D’}
set_B={‘A’, ‘B’, ‘C’, ‘D’}
print(set_A – set B)
print(set_A.difference( set_B))
Output:
{2/4}
{2/4}

Symmetric difference:

  • Symmetric difference includes all the elements that are in two sets (say sets A and B) but not the one that are common to two sets.
  • The caret (^) operator is used to symmetric difference set operation in python.
  • The function symmetric_difference( ) is also used to do the same operation.

Example:
Program to symmetric difference of two
sets using caret operator and symmetric
difference function
set_A={‘A’, 2,4, ‘D’}
set_B={‘A’, ‘B’, ‘C’, ‘D’}
print(set_A ^ set_B)
print( set_A.symmetric_difference(set_B))
Output:
{2,4,’B’,’C’}
{2,4, ‘B’, ‘C’}

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

12th Computer Science Guide Lists, Tuples, Sets and Dictionary Additional Important Questions and Answers

I. Choose the best answer (1 Mark)

Question 1.
A list in python is denoted by ………………………..
(a) [ ]
(b) { }
(c) <>
(d) #
Answer:
(a) [ ]

Question 2.
Which of the following is an ordered collection of values?
a) Tuples
b) List
c) Set
d) Dictionary
Answer:
b) List

Question 3.
Each value of a list is called as
(a) Set
(b) Dictionary
(c) Element
(d) Strings
Answer:
(c) Element

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 4.
In the list, the negative index number begins with
a) 0
b) 1
c) -1
d) 0.1
Answer:
c) -1

Question 5.
To access the list elements in reverse order, ……………………. value has to be given
(a) 0
(b) positive
(c) imaginary
(d) negative
Answer:
(d) negative

Question 6.
Which of the following can be used to access an element in a list?
a) Index value
b) Function
c) Integer
d) Identifier
Answer:
a) Index value

Question 7.
In sim = [4,20,71,89], the negative index value of 20 is
a) 2
b) -2
c) -1
d) -3
Answer:
d) -3

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 8.
Which function is used to set the upper limit in a loop to read all elements of a list?
a) upper ()
b) limit
c) len ()
d) loop ()
Answer:
c) len ()

Question 9.
Which function shows the deleted element as soon as the element is deleted
a) Remove
b) pop
c) Delete
d) erase
Answer:
b) pop

Question 10.
What is the output for the following?
sim = [T’, ‘E’, ‘A’, ‘M’]
for i in sim:
print (sim [2])
a) T
b) A
c) C
d) M
Answer:
b) A

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 11.
…………………….. operator is used to changing the list of elements
(a) =
(b) +
(c) +=
(d) *=
Answer:
(a) =

Question 12.
Which of the following function is used to add more than one element in an existing list?
a) append ()
b) extend ()
c) more ()
d) addmore ()
Answer:
b) extend ()

Question 13.
What is the output for the following,
mylist = [34,45,48]
print(mylist. append (90))
a) 34,45,48,90
b) 90,34,45,48
c) 34,45,90,84
d) 34,45,90,48
Answer:
a) 34,45,48,90

Question 14.
Which of the following function used to include an element in a list at the desired position?
a) append ()
b) extend ()
c) insert ()
d) format ()
Answer:
c) insert ()

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 15.
Write the output,
list = [34, 45, 48]
list.append(90)
(a) [34, 45, 48, 90]
(b) [90, 34, 45, 48]
(c) [34, 90, 45, 48]
(d) [34, 45, 90, 48]
Answer:
(a) [34, 45, 48, 90]

Question 16.
Which function can also be used to delete one or more elements if the index value is not known.
a) push()
b) remove ()
c) delete ()
d) delmore ()
Answer:
b) remove ()

Question 17.
Which of the following command deletes only the elements in the list?
a) erase ()
b) pop ()
c) clear ()
d) remove ()
Answer:
c) clear ()

Question 18.
Creating a Tuple with one element is called a tuple.
a) mono
b) single
c) Singleton
d) Singular
Answer:
c) Singleton

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

II. Answer the following questions (2 and 3 Marks)

Question 1.
Write a note on the nested list?
Answer:
My list = [ “Welcome”, 3.14, 10, [2, 4, 6] ]
In the above example, My list contains another list as an element. A nested list is a list containing another list as an element.

Question 2.
Give short notes on Tuple’s assignment.
Answer:

  • Tuple assignment is a powerful feature in Python.
  • It allows a tuple variable on the left of the assignment operator to be assigned to the values on the right side of the assignment operator.
  • Each value is assigned to its respective variable.

Example;
>>> (a,b;c) = (34, 90, 76)
>>> print(a.b,c)
34 90 76

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 3.
Explain how can you create a set in python with an example.
Answer:

  • A set is created by placing all the elements separated by comma within a pair of curly brackets.
  • The set( ) function can also used to create sets in Python.

Syntax:
Set_ Variable = {E1, E2, E3 En}

Example:
>>> S1 = {1,2,3,’A’,3.14}
>>> print(S1)
{1, 2, 3, 3.14, ‘A’}
>>> S2={1,2,2,’A’,3.14}
>>> print(S2)
{1,2,’A’, 3.14}

Question 4.
What is meant by Reverse Indexing?
Answer:
Python enables reverse or negative indexing for the list elements. Thus, python lists indexes in the opposite order. The python sets -1 as the index value for the last element in list and -2 for the preceding element and so on. This is called Reverse Indexing.

Question 5.
Explain Dictionary Comprehension.
Answer:
In Python, comprehension is another way of creating a dictionary.

Syntax: ,
Diet = {expression for variable in sequence
[if condition]}
The if condition is optional and if specified, only those values in the sequence are evaluated using the expression which satisfy the condition.

Example:
Diet = {x : 2 * x for x in range(1,10)}
Output:
{1: 2,2: 4, 3: 6,4: 8,5:10,6:12,7:14,8:16,9:18}

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 6.
What are the four collections of data types in a python programming language?
Answer:
Python programming language has four collections of data types such as List, Tuples, Set, and Dictionary.

Question 7.
Differentiate clear( ) and del in list?
Answer:
The function clear( ) is used to delete all the elements in list, it deletes only the elements and retains the list. Remember that, the del statement deletes entire list.

Question 8.
Differentiate append () and extend () function..
Answer:

append () extend ()
append() function is used to add a single element extend() the function is used to add more than one element to an existing list.

Question 9.
What will be the output of the following snippet?
Answer:
alpha=list(range(65,70))
for x in alpha:
print(chr(x), end=’\t’)
Output:
A B C D E

Question 10.
What will be the output of the following code?
Answer:
list=[3** x for x in range (5)]
print(list)
Output: [1, 3, 9, 27,81]

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 11.
How to delete elements from the list.
Answer:

  • There are two ways to delete an element from a list viz. del statement and remove() function.
  • del statement is used to delete known elements whereas removing] ) the function is used to delete elements of a list if its index is unknown.
  • The del statement can also be used to delete the entire list.

Syntax:
To delete a particular element:
del List [index of an element]
To delete multiple elements:
del List [index from : index to]
To delete entire list:
del List Syntax: remove ()
# to delete a particular element
List. remove (element)

Question 12.
Write notes on pop () and clear () function.
Answer:
Pop() function:

  • pop () function can also be used to delete an element using the given index value.
  • pop () function deletes and returns the last element of a list if the index is not given.

Syntax : List.pop(index of an element)
clear () function:

  • clear () function is used to delete all the elements in list.
  • It deletes only the elements and retains the list.

Syntax: List.clear()

Question 13.
Define Tuple in python with syntax?
Answer:

  • Tuples consists of a number of values separated by comma and enclosed within parentheses.
  • Tuple is similar to list, values in a list can be changed but not in a tuple.

Syntax:
#Empty tuple:
Tuple_Name = ()
#Tuple with n number elements:
Tuple_Name = () (E1, E2, E3, En)
#Elements of a tuple without parenthesis:
Tuple_Name = E1, E2, E3, …….. En

Question 14.
Write notes on tuple () function? Give example.
Answer:

  • The tuple ( ) function is used to create Tuples from a list.
  • When you create a tuple from a list, the elements should be enclosed within square brackets.

Example:
MyTup3 = tuple( [23,45,90])
>>> print(MyTup3)
(23,45,90)

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 15.
How to create a set using a list or tuple? Give an example.
Answer:

  • A list or Tuple can be converted as set by using set() function.
  • First a List or Tuple can be created then, substitute its variable within set() function as argument.

Example:
MyList= [2,4,6,8,10]
MySet=set(MyList)
print(MySet)
Output:
[2,4, 6,8,10}

Question 16.
Give notes on Dictionary in Python.
Answer:

  • Dictionary is a mixed collection of elements.
  • Unlike other collection data types such as a list or tuple, the dictionary type stores a key along with its element.
  • The keys in a Python dictionary is separated by a colon ( : ) while the commas work as a separator for the elements.
  • The key-value pairs are enclosed with curly braces {}.

Question 17.
Give notes on len() function of a list with
an example.
Answer:

  • The len() function in Python is used to find the length of a list. (i.e., the number of elements in a list).
  • Usually, the len() function is used to set the upper limit in a loop to read all the elements of a list.
  • If a list contains another list as an element, len() returns that inner list as a single element.

Example:
Accessing single element
>>> MySubject = [‘Tamil’, ‘English’,
‘Comp’, ‘Science’, ‘Maths’]
>>>len(MySubject)
4

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 18.
Define List comprehensions.
Answer:
List comprehension is the simplest way of creating a sequence of elements that satisfy a certain condition.
Syntax:
List = [ expression for variable in range ]

Example:
Generating squares of first 10 natural numbers using the concept of List comprehension.
>>> squares = [x ** 2 for x in range(l, 11) ]
>>> print (squares)
Output:
[1,4,9,16,25,36,49,64,81,100]

Question 19.
What is the difference in between List and Tuple.
Answer:

List Tuple
1 In a list, elements are defined within square brackets. Tuples consists of a number of values separated by comma and enclosed within parentheses even defined without parenthesis
2 Values in a list can be changed Values in a tuple cannot be changed

Question 20.
Write execution table for the following Python code.
Answer:
Marks=[10/ 20, 30,40, 50]
i = 0
sum = 0
while i < 4
sum+=Marks[i]
i+=1

Execution Table:

S.No i i<4 Marks Sum i + 1
1 0 0<4 (True) 10 10 1
2 1 1<4 (True) 20 30 2
3 2 2< 4 (True) 30 60 3
4 3 3<4 (True) 40 . 100 4
5 4 4<4 (False)

Question 21.
What will be the output of the following snippet?
Answer:
Mydict={chr(x):x for x in range(97,102)} Print(Mydict)
Output:
{‘a’: 97, ‘b’: 98, ‘c’: 99, ‘d’: 100, ‘e’: 101}

Question 22.
What will be the output of the following snippet?
Answer:
set_A = {‘A’. 2,4, ‘D’}
Set_B = {‘A’, ‘B’, ‘C’, ‘D’}
print(set_A & set_B)
Output:
{‘A’, ‘D’}

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

III. Answer the following questions (5 Marks)

Question 1.
Explain how to access all elements of a list using while ioop with suitable example
Answer:

  • Loops are used to access all elements from a list. 1PTA – 61
  • The initial value of the ioop must be zero.
  • Zero is the beginning index value of a list.

Example:
Marks = [10, 23,41,75] .
i=O
whilei<4:
print (Marks[i])
i=i+1

Output:
10
23
41
75

  • In the above example, Marks list contains four integer elements i.e., 10, 23, 41, 75. Each element has an. index value from 0. The index value of the elements are 0,1, 2, 3 respectively.
  • Here, the while loop is used to read all the elements. The initial value of the loop is zero, and the test condition is < 4, as long as the test condition is true, the loop executes and prints the corresponding output.
  • During the first iteration, the value of i is zero, where the condition is true.
  • Now, the following statement print (Marks [i] gets executed and prints the value of Marks [0] element ie. 10.
  • The next statement i = i + 1 increments the value of i from 0 to 1.
  • Now, the flow of control shifts to the while statement for (vi) checking the test condition.
  • The process repeats to print the remaining elements of Marks list until the test condition of while loop becomes false.

The following table shows that the execution of loop and the value to be print.

Iteration i while
i<4
print
(Marks[i])
i=i +1
1 0 0< 4 True Marks [0] =10 0+1=1
2 1 1 < 4 True Marks [1]=23 1+1=2
3 2 2 < 4 True Marks [2] =41 2+1=3
4 3 3 < 4 True Marks [3]=75 3+1=4
5 4 4 < 4 False

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 2.
Write a python program using list to read marks of six subjects and to print the marks scored in each subject and show the total marks.
Python program to read marks of six subjects and to print the marks scored in each subject and show the total marks
Answer:
marks=[ ]
subjects=[‘Tamir, ‘English’, ‘Physics’, ‘Chemistry’, ‘Comp. Science’, ‘Maths’]
for i in range(6):
m=int(input(“Enter Mark = “))
marks.append(m)
for j in range(len(marks)):
print(“{ }. { } Mark= { } “.format(jl+,subjects[j],marks[j]))
print(“Total Marks = “, sum(marks))
Output:

  • Enter Mark = 45
  • Enter Mark = 98
  • Enter Mark = 76
  • Enter Mark = 28
  • Enter Mark = 46
  • Enter Mark = 15
    1. Tamil Mark = 45
    2. English Mark = 98
    3. Physics Mark = 76
    4. Chemistry Mark = 28
    5. Comp. Science Mark = 46
    6. Maths Mark = 15
    7. Total Marks = 308

Question 3.
Explain remove, pop () and clear () used in list with an example.
Asnwer:
remove():
The remove() function can also be used to delete one or more elements if the index value is not known.
Syntax: List.remove(element) # to delete a particular element
Example: >>>MyList = [12,89,34/Kannan’, ‘Gowrisankar’, ‘Lenin’]
>>> print(MyList)
[12,89,34, ‘Karman’, ‘Gowrisankar’, ‘Lenin’)
>>>MyList.remove(89)
>>>print(MyList)
[12, 34, ‘Karman’, ‘Gowrisankar’, ‘Lenin’]

pop ():

  • pop() function can also be used to delete an element using the given index value.
  • Pop() function deletes and returns the last element of a list if the index is not given.
  • pop() function is used to delete a particular element using its index value, as soon as the element is deleted.
  • The pop() function shows the element which is deleted, pop ( ) function is used to delete only one element from a list.

Syntax:
List, pop (index of an element)

Example:
>>> MyList.pop(1)
34
>>> print (My List)
[12, ‘Kannan’, ‘Gowrisankar’, ‘Lenin’)

clear ():

  • The clear() function is used to delete all the elements in list, it deletes only the elements and retains the list.
  • clear () function removes only the elements and retains the list.
  • When you try to print the list which is already cleared, an empty square bracket is displayed without any elements, which means the list is empty.

Syntax:
List.clear()
Example:
>>>MyList.clear()
>>> print(MyList)
[]

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 4.
Explain the following functions used in list function with an example. max(), min(),sum()
Answer:

Function

Description Syntax

Example

max() Returns the maximum value in a list. max (list) MyList= [21,76,98,23] print(max(MyList))
Output:
98
min() Returns the minimum value in a list. min(list) My List= [21,76,98,23] print (min(My List))
Output:
21
sum() Returns the sum of values in a list. sum(list) My List= [21,76,98,23] print(sum(MyList))
Output:
218

Question 5.
Explain the following functions used in list function with an example. 1. copy () 2. count () 3. index () 4. reverse () 5.sort ()
Answer:

Function Description Syntax Example
copy () Returns a copy of the list List.copy() MyList=[12,12, 36] x = MyList.copy() print(x)
Output:
[12,12, 36]
count () Returns the number of similar elements present in the list. List.

count(value)

MyList=[36,12,12] x = MyList.count(12) print(x)
Output:
2
index () Returns the index value of the first recurring element List.

index (element)

MyList=[36,12,12] x = MyList.index(12) print(x)
Output:
0
reverse () Reverses the order of the element in the list. List.reverse() MyList=[36,23,12] MyList.reverse() print(MyList)
Output:
[12,23,36]
sort () Sorts the element in list List.sort(reverse=True | False, key=myFunc)
Both arguments are optional If the reverse is set as True, list sorting is in descending order.
Ascending is the default.
Key=myFunc; “myFunc” – the name of the user defined function that specifies the sorting criteria.
Note: sort() will affect the original list.
My List= [‘Thilothamma, Tharani’, ‘Anitha, ‘SaiSree, ‘Lavanya’] MyList.sort() print(MyList)
MyList.sort(reverse=True)
print(MyList)
Output:
[‘Anitha7, ‘Lavanya7, ‘SaiSree’, ‘Tharani7, ‘Thilothamma7]
[‘Thilothamma7, ‘Tharani7, ‘SaiSree7, 7Lavanya7, ‘Anitha’]

Question 6.
Answer:
6. What will be the output of the following Python program?
A{x*3 for x in range (1,6))
B{y**2 for y in range (1,10,2))
print(A)
print(B) .
print(A | 13)
print(A-B)
print(A&B)
print (A ^ B)
Output:
A={x*3 for x in range(1,6)}
B={y**2 for y in range(1,10,2)}
print(A) → {3, 6, 9, 12, 15}
print(B) → {1, 9, 25, 49, 81}
print (A I B) → {1, 3, 6, 9, 12, 15, 25, 49, 81}
print(A-B) → {3, 6, 12, 15}
print(A&B) → {9}
print(A”B) → {1, 3, 6, 12, 15, 25, 49, 81}

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 7.
What will be the output of the following Python program?
N = [ ]
for x in range(l,ll):
N.append(x)
Num=tuple(N)
print(Num)
for index, i in enumerate(N): if(i%2==l): .
del N[index]
print(N)
Output:
[2,4, 6, 8,10]

Question 8.
What will be the output of the following Python program?
A ={x*3 for x in range (1,6)}
B={y**2 for y in range (1,10,2)}
Print(A)
Print(B)
Print(A | B)
Print(A-B)
Print(A&B)
Print(AAB)
Output:
>>> A={x*3 for x in range(l,6)}
>>> B={y**2 for y in range(1,10,2)}
>>> print(A)
{3, 6, 9,12,15}
>>>print(B)
{1, 9,81,49,25}
>>> print(A | B)
{1,3, 6, 9,12,15, 81,49, 25}
>>> print(A-B)
{3,12, 6,15}
>>> print(A&B)
{9}
>>> print(A^B)
{1,3, 6,12,15, 81, 25,49}

Samacheer Kalvi 12th Computer Science Guide Chapter 9 Lists, Tuples, Sets and Dictionary

Question 9.
Write a program using a function that returns the area and circumference of a circle whose radius is passed as an argument two values using tuple assignment. Program using a function that returns the area and circumference of a circle whose radius is passed as an argument. Assign two values using tuple assignment:
Answer:
pi = 3.14
def Circle(r):
return (pi*r*r, 2*pi*r)
radius = float(input(“Enter the Radius! “))
(area, circum) = Circle(radius)
print (“Area of the circle = “, area)
print (“Circumference of the circle = “, circum)
Output:
Enter the Radius: 5
Area of the circle = 78.5
Circumference of the circle = 31.400000000000002

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Computer Science Guide Pdf Chapter 6 Control Structures Text Book Back Questions and Answers, Notes.

Tamilnadu Samacheer Kalvi 12th Computer Science Solutions Chapter 6 Control Structures

12th Computer Science Guide Control Structures Text Book Questions and Answers

I. Choose the best answer (1 Mark)

Question 1.
How many important control structures are there in Python?
a) 3
b) 4
c) 5
d) 6
Answer:
a) 3

Question 2.
elif can be considered to be abbreviation of
a) nested if
b) if..else
c) else if
d) if..elif
Answer:
c)else if

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 3.
What plays a vital role in Python programming?
a) Statements
b) Control
c) Structure
d) Indentation
Answer:
d) Indentation

Question 4.
Which statement is generally used as a placeholder?
a) continue
b) break
c) pass
d) goto
Answer:
c) pass

Question 5.
The condition in the if statement should be in the form of
a) Arithmetic or Relational expression
b) Arithmetic or Logical expression
c) Relational or Logical expression
d) Arithmetic
Answer:
c) Relational or Logical expression

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 6.
Which is the most comfortable loop?
a) do..while
b) while
c) for
d) if..elif
Answer:
c) for

Question 7.
What is the output of the following snippet?
i=l
while True:
if i%3 ==0:
break
print(i/end=”)
i +=1
a) 12
b) 123
c) 1234
d) 124
Answer:
a) 12

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 8.
What is the output of the following snippet?
T=1
while T:
print(True)
break
a) False
b) True
c) 0
d) no output
Answer:
b) True

Question 9.
Which amongst this is not a jump statement ?
a) for
b) goto
c) continue
d) break
Answer:
a) for

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 10.
Which punctuation should be used in the blank?
if < condition >
statements-block 1
else:
statements-block 2
a) ;
b) :
c) ::
d) !
Answer:
b) :

II. Answer the following questions (2 Marks)

Question 1.
List the control structures in Python.
Answer:
There are three important control structures

  1. Sequential
  2. Alternative or Branching
  3. Iterative or Looping

Question 2.
Write note on break statement.
Answer:

  • The break statement terminates the loop containing it.
  • Control of the program flows to the statement immediately after the body of the loop.
  • When the break statement is executed, the control flow of the program comes out of the loop and starts executing the segment of code after the loop structure.
  • If break statement is inside a nested loop (loop inside another loop), break will terminate the innermost loop.

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 3.
Write is the syntax of if..else statement
Answer:
Syntax:
if:
statements – block 1
else:
statements – block 2

Question 4.
Define control structure.
Answer:
A program statement that causes a jump of control from one part of the program to another is called a control structure or control statement.

Question 5.
Write note on range () in loop
Answer:
Usually in Python, for loop uses the range() function in the sequence to specify the initial, final and increment values. range() generates a list of values starting from start till stop – 1.

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

III. Answer the following questions (3 Marks)

Question 1.
Write a program to display
Answer:
A
AB
ABC
ABCD
ABCDE
For i in range (1,6,1):
ch=65
for j in range (ch,ch+i,1):
a=chr(j)
print (a, end =’ ‘)
print ()

Question 2.
Write note on if..else structure.
Answer:
The if-else statement provides control to check the true block as well as the false block. Following is the syntax of ‘if-else’ statement.
Syntax:
if:
statements – block 1
else:
statements – block 2

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 3.
Using if..else..elif statement write a suitable program to display largest of 3 numbers.
Answer:
a = int (input (“Enter number 1″)
b = int (input (” Enter number 2″)
c = int (input (” Enter number 3″)
if a > b and a > c:
put (” A is greatest”)
elif b > a and b > c:
print (“B is greatest”)
else:
print (“C is greatest”)

Question 4.
Write the syntax of while loop.
Answer:
The syntax of while loop in Python has the following syntax:
Syntax:
while:
statements block 1
[else:
statements block 2]

Question 5.
List the differences between break and continue statements.
Answer:

Break

Continue

Break statement terminates the loop containing it and control reaches after the body of the loop Continue statement skips the remaining part of a loop and start with next iteration.

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

IV. Answer the following questions (5 Marks)

Question 1.
Write a detail note on for loop
Answer:
for loop:

  • for loop is the most comfortable loop. It is also an entry check loop.
  • The condition is checked in the beginning and the body of the loop
    (statements-block 1) is executed if it is only True otherwise the loop is not executed.

Syntax:
for counter_variable in
sequence:
statements – block 1
[else: # optional block statements – block 2]

  • The counter, variable mentioned in the syntax is similar to the control variable that we used in the for loop of C++ and the sequence refers to the initial, final and increment value.
  • Usually in Python, for loop uses the range () function in the sequence to specify the initial, final and increment values, range () generates a list of values starting from start till stop-1.

The syntax of range() follows:
range (start, stop, [step])
Where,
start – refers to the initial value
stop – refers to the final value
step – refers to increment value,
this is optional part.

Examples for range():
range (1,30,1) – will start the range of values from 1 and end at 29 range (2,30,2) – will start the range of values from 2 and end at 28 range (30,3,-3) – will start the range of values from 30 and end at 6E range (20) – will consider this value 20 as the end value ( or upper limit) and starts the range count from 0 to 19 (remember always range () will work till stop -1 value only)

Example-Program:
#Program to illustrate the use of for loop – to print single digit even number
for i in range (2,10,2):
print (i, end=”)

Output:
2468
Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures 1

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 2.
Write a detail note on if..else..elif statement with suitable example.
Answer:

  • When we need to construct a chain of if statement(s) then ‘elif’ clause can be
    used instead of ‘else’.
    Syntax:
    if < condition -1>:
    statements-block 1
    elif< condition -2>:
    statements-block 2
    else:
    statements-block n
  • In the syntax of if..elif ..else mentioned above, condition -1 is tested if it is true then statements-block 1 is executed, otherwise, the control checks condition-Z, if it is true statements- block2 is executed and even if it fails statements-block n mentioned in else part is executed.
  • ‘elif’ clause combines if..else- if ..else statements to one if..elif … else, “elif’ can be considered to be abbreviation of ‘else if’. In an’if’ statement there is no limit of ‘elif’ clause that can be used, but an clause if used should be placed at the end.

Example:

# Program to illustrate the use of nested if statement
Average – Grade
> =80 and above A
> =70 and above B
> =60 and <70 C
> =50 and <60 D
Otherwise E

Example-program
m1 = int (input(“Enter mark in first subject:”))
m2 = int (input(” Enter mark in second subject:”))
avg = (ml+ml)/2
if avg> =80:
print (“Grade: A”)
elif avg> =70 and avg< 80:
print (“Grade: B”)
elif avg> =60 and avg< 60:
print (“Grade: C”)
elif avg> =50 and avg< 60: .
print (“Grade: D”)
else:
print(“Grade: E”)

Output 1:
Enter mark in first
subject: 34
Enter mark in second
subject: 78
Grade: D

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 3.
Write a program to display all 3 digit odd numbers.
Answer:
Odd Number (3 digits)
for a in range (100, 1000)
if a % 2 = = 1:
print b
Output:
101, 103, 105, 107, .. …… 997, 999

Question 4.
Write a program to display multiplication table for a given number.
Answer:
Coding:
num=int(input(“Display Multiplication Table of “))
for i in range(1,11):
print(i, x ,num, ‘=’, num*i)
Output:
Display Multiplication Table of 2
1 x 2 = 2
2 x 2 = 4
3 x 2 = 6
4 x 2 = 8
5 x 2 = 10
6 x 2 = 12
7 x 2 =14
8 x 2 = 16
9 x 2 =18
10 x 2 = 20
>>>

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

12th Computer Science Guide Control Structures Additional Questions and Answers

I. Choose the best answer ( I Mark)

Question 1.
Executing a set of statements multiple times are called…………………………..
(a) Iteration
(b) Looping
(c) Branching
(d) Both a and b
Answer:
(d) Both a and b

Question 2.
………… important control structures are available in python.
a) 2
b) 3
c) 4
d) many
Answer:
b) 3

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 3.
Identify which is not a control structure?
(a) Sequential
(b) Alternative
(c) Iterative
(d) Break
Answer:
(d) Break

Question 4.
To construct a chain of if statement, else can be replaced by
a) while
b) ifel
c) else if
d) elif
Answer:
d) elif

Question 5.
Branching statements are otherwise called……………………………
(a) Alternative
(b) Iterative
(c) Loop
(d) Sequential
Answer:
(a) Alternative

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 6.
Which statement is used to skip the remaining part of a loop and start with the next iteration?
a) continue
b) break
c) pass
d) condition
Answer:
a) continue

Question 7.
In the …………….. loop, the condition is any valid Boolean expression returning True or false.
a) if
b) else
c) elif
d) while
Answer:
d) while

Question 8.
How many blocks can be given in Nested if.. elif.. else statements?
(a) 1
(b) 2
(c) 3
(d) n
Answer:
(d) n

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 9.
A loop placed within another loop is called as …………… loop structure.
a) entry check
b) exit check
c) nested
d) conditional
Answer:
c) nested

Question 10.
What types of Expressions can be given in the while loop?
(a) Arithmetic
(b) Logical
(c) Relational
(d) Boolean
Answer:
(d) Boolean

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

II. Answer the following questions (2 and 3 Marks)

Question 1.
Write a note on sequential statements?
Answer:
A sequential statement is composed of a sequence of statements which are executed one after another. A code to print your name, address, and phone number is an example of a sequential statement.

Question 2.
Write the syntax of for loop.
Answer:
Syntax:
for counter_variable in sequence:
statements-block 1
[else: # optional block
statement-block 2]

Question 3.
Define loops?
Answer:
Iteration or loop are used in a situation when the user needs to execute a block of code several times or till the condition is satisfied. A loop statement allows executing a statement or group of statements multiple times.

Question 4.
What is meant by Nested loop structure?
Answer:

  • A loop placed within another loop is called a nested loop structure.
  • A while; within another while; for within another for;
  • For within while and while within for to construct nested loops.

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 5.
Give the syntax of range O in for loop?
Answer:
The syntax of range ( ) is as follows:
range (start, stop, [step] )
Where,
start – refers to the initial value
stop – refers to the final value
step – refers to increment value, this is an optional part.

Question 6.
Write a note on the pass statement.
Answer:

  • pass statement in Python programming is a null statement.
  • pass statement when executed by the interpreter it is completely ignored.
  • Nothing happens when the pass is executed, it results in no operation.

III. Answer the following questions (5 Marks)

Question 1.
Explain the types of alternative or branching statements provided by Python?
Answer:
The types of alternative or branching statements provided by Python are:

  1. Simple if statement
  2. if..else statement
  3. if..elif statement

1) Simple if statement
Simple if is the simplest of all decision-making statements. The condition should be in the form of relational or logical expression.
Syntax:
if:
statements-block1
Example:
x=int (input(“Enter your age :”))
if x > =18:
print (“You are; eligible for voting”)
Output:
Enter your age :34
You are eligible for voting

2) if..else statement
The if.. else statement provides control to check the true block as well as the false block. Following is the syntax of ‘if..else statement.
Syntax:
if:
statements-block 1
else:
statements-block 2
Example:
a = int(input(” Enter any number :”))
if a%2==0:
print (a, ” is an even number”) else:
print (a, ” is an odd number”)
Output 1:
Enter any number:56
56 is an even number
Output 2:
Enter any number:67
67 is an odd number
Flowchart- if..else statement Execution
Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures 2
3) Nested if..elif…else statement:

  • When we need to construct a chain of if statement(s) then ‘elif’ clause can be used instead of ‘else.
  • ‘elif’ clause combines if..else-if.. elsestatements to one if ..elif… else. elif can be considered to be abbreviation of else if.
  • In an ‘if statement there is no limit of ‘elif clause that can be used, but an ‘else clause if used should be placed at the end.

Syntax:
if<statements-block 1>:
elif :
statements-block 2
else:
statements-block n
Example:
a = int (input (“Enter number 1″)
b = int (input (” Enter number 2″)
c = int (input (” Enter number 3″)
if a > b and a > c:
put (” A is greatest”)
elif b > a and b > c:
print (“B is greatest”)
else:
print (“C is greatest”)

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 2.
Explain while loop with example.
Answer:

  • While loop belongs to entry check loop type, that is it is not executed even once
    if the condition is tested False in the beginning.
  • In the while loop, the condition is any valid Boolean expression returning
    True or False.
  • The else part of while is optional part of while. The statements blocki is kept
    executed till the condition is True.
  • If the else part is written, it is executed when the condition is tested False.

Syntax:
while< condition >:
statements block 1
[else:
statements block 2]
Flowchart-while loop execution:
Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures 3
Example:

i=10 # intializing part of the control variable
while (i<=15): # test condition
print (i,end=,\t/) # statements – block1
i=i+1 # Updation of the control variable

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 3.
Explain the Jump statement in python.
Answer:

  • The jump statement in Python is used to unconditionally transfer the control from one part of the program to another.
  • There are three keywords to achieve jump statements. in Python: break, continue, pass.

Flowchart -Use of break, continue statement in loop structure:

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures 4

  • break statement:
  • The break statement terminates the loop containing it.
  • Control of the program flows to the statement immediately after the body of the loop.
  • A while or for loop will iterate till the condition is tested false, but one can even transfer the control out of the loop (terminate) with help of a break statement.
  • When the break statement is executed, the control flow of the program comes out of the loop and starts executing the segment of code after the loop structure.
  • If the break statement is inside a nested loop (loop inside another loop), the break will terminate the innermost loop. Syntax for break statement:
    break
    Example: for word in “Jump Statement”:
    ifword = = “e”:
    break print (word, end= “)
    Output: Jump Stat
    Flowchart- Working of break statement:

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures 5
Working of break statement

continue statement: Continue statement unlike the break statement is used to skip the remaining part of a loop and start with the next iteration.

Syntax of continue statement:
continue Example:
for word in “Jump Statement”:
if word = = “e”:
continue print (word, end=”)
print (“\n End of the program”)

Output:
Jump Statement
End of the program

pass statement:

  • pass statement is generally used as a placeholder.
  • When we have a loop or function that is to be implemented in the future and not now, we cannot develop such functions or loops with empty body segments because the interpreter would raise an error.
  • So, to avoid this we can use a pass statement to construct a body that does nothing.

Syntax of pass statement:
pass

Example:
forval in “Computer”:
pass
print (“End of the loop, loop structure will be built in future”)
Output: End of the loop, loop structure will be built in future

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 4.
What kind of Nested ioop structure can be created?
Answer:

  • A loop placed within another loop is called a nested loop structure.
  • A while; within another while; for within another for;
  • for within while and while within to construct nested loops.

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures 6

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures 7

HANDS-ON PRACTICE

Question 1.
Write a program to check whether the given character is a vowel or not.
Answer:
Coding:
ch=input (“Enter a character :”)
# to check if the letter is vowel
if ch in (‘a’, ‘A’, e , E , i , I , o ,O , u’, ‘U’):
print (ch/ is a vowel’)
Output:
Enter a character:e
e is a vowel

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 2.
(i) Write a program to display all 3 digit even numbers.
(ii) Write the output for the following program.
Answer:
i=1
while (i<=6):
for j in range (1, i):
print(j, end=’\t’)
print (end=’ \ n’)
i+=1
i) Python Program:
for i in range(100,1000,2):
Print(i)
ii) Output: 1
1 2
1 2 3
1 2 3 4
1 2 3 4 5

Question 3.
Write a program to check if a number is Positive, Negative or zero.
Answer:
Coding:
num = float(input(” Enter a number: “))
if num > 0:
print(“Positive number”)
elifnum == 0:
print(“Zero”)
else:
print(“Negative number”)
Output:
Enter a number:5
Positive number

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 4.
Write a program to display Fibonacci series 0112345 (up to n terms)
Answer:
Coding:
Number = int(input(“\n Please Enter the Range Number: “))
i = 0
First_ Value = 0
Second-Value = 1
while(i < Number):
if(i <= 1):
Next = i else:
Next = First-Value + Second_Value
First_Value = Second_Value
Second_Value = Next
print(Next)
i = i + 1
Output:
Please Enter the Range Number: 4
0
1
1
2
3

Question 5.
Write a program to display sum of natural numbers, up to n.
Answer:
Coding:
number = int(input(“Please Enter any Number:”))
total = 0
for value in range(l, number + 1):
total = total + value
print(“The Sum of Natural Numbers is total)
Output:
Please Enter any Number:5
The Sum of Natural Numbers is : 15

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 6.
Write a program to check if the given number is a palindrome or not.
Answer:
Coding:
n=int(input(“Enter number:”))
temp=n
rev=0
while(n>0):
dig=n%10
rev=rev*10+dig
n=n//10
if(temp==rev):
print(“The number is a palindrome!”)
else:
print(“The number isn’t a palindrome!”)
Output:
isn’t a palindrome!

Question 7.
Write a program to print the following pattern
* * * * *
* * * *
* * *
* *
*
Answer:
Coding:
number = int(input(“Please Enter Pattern Number: “))
for i in range(number,0,-l):
for j in range(1,i+1,1):
print(“*”, end”)
print()
Output:
Please Enter Pattern Number:5
* * * * *
* * * *
* * *
* *
*

Samacheer Kalvi 12th Computer Science Guide Chapter 6 Control Structures

Question 8.
Write a program to check if the year is leap year or not.
Answer:
Coding:
def leap_year(y):
.’ if (y % 400 = = 0):
print(y, “is the leap year”)
elif(y%4 = = 0):
print(y, “is the leap year”)
else:
print(y, “is not a leap year”)
year = int(input(“Enter a year…”)
print(leap_year(year))
Output:
Enter a year… 2007
2007 is the leap year

Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems

Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Business Maths Guide Pdf Chapter 5 Numerical Methods Miscellaneous Problems Text Book Back Questions and Answers, Notes.

Tamilnadu Samacheer Kalvi 12th Business Maths Solutions Chapter 5 Numerical Methods Miscellaneous Problems

Question 1.
If f (x) = eax then show that f(0), Δf(0), Δ²f(0) are in G.P
Solution:
Given f(x) = eax
f(0) = e° = 1 ……… (1)
Δf(x) = ea(x+h) – eax
= e ax+ah – eax
= eax. eah – eax
= eax (eah – 1)
Δf(0) = e° (eah – 1)
= (eah – 1) …….. (2)
Δ²f(x)= Δ [Δf(x)]
= Δ [ea(x+h) – eax]
[ea(x+h+h) – ea(x+h)] – [ea(x+h) – eax]
= ea(x+2h) – ea(x+h) – ea(x+h) + eax
Δ²f(0) = Δ [Δf(x)]
= ea(2h) – ea(h) – ea(h) + e0
= e2ah – eah – eah + 1
= (eah)² – 2eah + 1
= [eah – 1]² ………… (3)
from (1), (2) & (3)
[t2]² =[Δf(0)]² = (eah – 1)²
t1 × t3 = f(0) × Δ²f(0)
= (1)(eah – 1)² = (eah – 1)²
⇒ [Δf(0)]² = f(0) × Δ²f(0)
∴ f(0), Δf(0), Δ²f(0) an is G.P.

Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems

Question 2.
Prove that
(i) (1 + Δ) (1 – ∇) = 1
(ii) Δ∇ = Δ – ∇
(iii) EV = Δ = ∇E
Solution:
(i) LHS = (1 + Δ) (1 – ∇)
= (E) (E-1) = E1-1
= E° = 1
= RHS
Hence proved.

(ii) LHS = Δ∇
= (E – 1)(1 – E-1)
= E – EE-1 + E-1
= E – 1 – 1 – E-1
= E – 2 – E-1 ………… (1)
RHS = Δ – ∇
= (E – 1) -(1 – E-1)
= E – 1 – 1 + E-1
= E – 2 + E-1 ………. (2)
from (1) & (2) LHS = RHS
Hence proved.

Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems

(iii) E∇ = EE-1Δ [∵ ∇ = E-1Δ]
= Δ ……… (1)
∇E = E-1 ΔE
= E-1
= Δ ………. (2)
from (1) (2)
E∇ = Δ = ∇E

Question 3.
A second degree polynomial passes though the point (1, -1) (2, -1) (3, 1) (4, 5). Find the polynomial.
Solution:
Points are (1, -1), (2, -1), (3, 1) and (4, 5)
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 1
we will use Newton’s backward interpolation formula to find the polynomial.
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 2
= 5 + (x – 4) (4) + (x – 4) (x – 3) + 0
= 5 + 4x – 16 + x² – 7x + 12
y(x) = x² – 3x + 1

Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems

Question 4.
Find the missing figures in the following table
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 3
Solution:
Here y0 = 7; y1 = 11; y2 = ?; y3 = 18; y4 = ?; y5 = 32
Since only four values of f(x) are given, the polynomial which fits the data is of degree three. Hence fourth differences are zeros.
Δ4yk = 0
(ie) (E – 1)4 yk = 0
(i.e) (E4 – 4E³ + 6E² – 4E + 1)yk = 0 ……….. (1)
Put k = 0 in (1)
(E4 – 4E³ + 6E² – 4E + 1)y0 = 0
E4 y0 – 4E3 y0 + 6E² y0 – 4E y0 + y0 = 0
y4 – 4y3 + 6y2 – 4y1 + y0 = 0
y4 – 4(18) + 6y2 – 4(11) + 7 = 0
y4 – 72 + 6y2 – 44 + 7 = 0
y4 + 6y2 = 109
(2)
Put k = 1 in (1)
(E4 – 4E3 + 6E² – 4E + 1)y1 = 0
[E4 y1 – 4E y1 + 6E² y1 – 4Ey1 + y] = 0
y5 – 4y4 + 6y3 – 4y2 + y1 = 0
32 – 4 (y4) + 6(18) — 4(y2) + 11 = 0
32 – 4y4 + 108 – 4y2 + 11 = 0
-4y4 – 4y2 + 151 = 0
4y4 + 4y2 = 151 ,……. (3)
Solving equation (1) & (2)
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 4
Substitute y2 = 14.25 in eqn (1)
y4 + 6(14.25) = 109
y4 + 25.50 = 109
y4 = 109 – 85.5
∴ y4 = 23.5
∴ Required two missing values are 14.25 and 23.5.

Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems

Question 5.
Find f (0.5) if f(-1) = 202, f(0) = 175, f(1) = 82 and f(2) = 55
Solution:
From the given data
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 5
Here we have to apply Newton’s forward interpolation formula, since the value of f(x) is required near the beginning of the table.
y(x= x0+nh) =f(x0) + \(\frac { n }{1!}\) Δf(x0) + \(\frac { n(n-1) }{2!}\) Δ²f(x0) + \(\frac { n(n-1)(n-2) }{3!}\) Δ³f(x0) + ………
Given:
x = 0.5 and h = 1
x0 + nh = x
-1 + n(1) = 0.5
n = 1 + 0.5
∴ n = 1.5
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 6
= 202 – 40.5 – 24.75 – 8.25
= 202 – 73.5
f(0.5) = 128.5

Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems

Question 6.
From the following data find y at x = 43 and x = 84
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 7
Solution:
To find y at x = 43
Since the value of y is required near the beginning of the table, we use the Newton’s forward interpolation formula.
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 8
= 184 + (0.3) (20) + (0.3) (-0.7)
= 184 + 6.0 – 0.21
= 190 + 0.21
y(x=43) = 189.79
To find y at x = 84
Since the value of y is required at the end of the table, we apply backward interpolation formula.
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 9
xn + nh = x
90 + n(10) = 84
10n = 84 – 90
10n = -6
∴ n = -0.6
y(x=84) = 304 + \(\frac { (0.6) }{1!}\) (28) + \(\frac {(0.6)(-0.6 + 1) }{2!}\)(2) +
= 304 + (0.6) (28) + \(\frac { (-0.6)(0.4) }{2}\) + 2
= 304 – 16.8 – 0.24
= 304 – 17.04
= 286.96

Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems

Question 7.
The area A of circle of diameter ‘d’ is given for the following values
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 10
Find the approximate values for the areas of circles of diameter 82 and 91 respectively.
Solution:
To find A at D = 82
Since the value of A is required near the beginning of the table. We use the Newton’s forward interpolation formula.
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 11
= 5026 + 259.2 – 4.8 – 0.128 – 0.1664
= 5285.2 – 5.0944
= 5280.1056
A = 5280.11
To find Δ at D = 91
Since the value of A is required near the beginning of the table. We use the Newton’s forward interpolation formula.
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 12
= 7854 – 1378.8 + 28.8 + 0.096 + 0.0576
= 7882.9536 – 1378.8
= 6504.1536
= 6504.15

Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems

Question 8.
If u0 = 560, u1 = 556, u2 = 520, u4 = 385, show that u3 = 465
Solution:
U0 = 560; U1 = 556; U2 = 520; U4 = 385
Since only four values of U are given, the polynomial which fits the data is of degree three. Hence fourth differences are zeros.
Δ4U0
(E – 1)4 U0 = 0
⇒ (E4 – 4E³ + 6E² – 4E + 1) U0 = 0
⇒ E4U0 – 4E³U0 + 6E²U0 – 4EU0 + U0 = 0
U4 – 4U3 + 6U2 – 4U1 + U0 = 0
385 – 4(U3) + 6 (520) – 4 (556) + 560 = 0
385 – 4(U3) + 3120 – 2224 + 560 = 0
1841 – 4U3 = 0
4U3 = 1841 ⇒ U3 = \(\frac { 1841 }{4}\)
U3 = 460.25

Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems

Question 9.
From the following table obtain a polynomial of degree y in x
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 13
Solution:
We will use Newton’s backward interpolation formula to find the polynomial.
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 14
To find y in terms of x
xn + nh = x
5 + n(1) = x
∴ n = x – 5
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 15
= 1 + 2x – 10 + 2 (x² – 9x + 20) + \(\frac { 4 }{3}\) (x – 5) (x² – 7x + 12) + \(\frac { 2 }{3}\)(x² – 9x + 20)(x² – 5x + 6)
= 1 + 2x – 10 + 2x² – 18x + 40 + \(\frac { 4 }{3}\)
[x³ – 7x² + 12x – 5x² + 35x – 60] + \(\frac { 2 }{3}\) [x4 – 5x³ + 6x² – 9x³ + 45x² – 54x + 20x² – 100x + 120]
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 16

Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems

Question 10.
Using Lagrange’s interpolation formula find a polynominal which passes through the points (0, -12), (1, 0), (3, 6) and (4, 12).
Solution:
We can construct a table using the given points.
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 17
Here x0 = 0; x1 = 1; x2 = 3; x3 = 4,
y0 = -12; y1 = 0; y2 = 6; y3 = 12
Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems 18
= (x³ – 7x² + 12x – x² + 7x – 12) – (x³ – 5x² + 4x) + (x³ – 4x² + 3x)
= (x³ – 8x² + 19x – 12) – (x³ – 5x² + 4x) + (x³ – 4x² + 3x)
= x³ – 8x² + 19x – 12 – x³ + 5x² – 4x + x³ – 4x² + 3x
∴ y = x³ – 7x² + 18x – 12

Samacheer Kalvi 12th Business Maths Guide Chapter 5 Numerical Methods Miscellaneous Problems

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Economics Guide Pdf Chapter 9 Fiscal Economics Text Book Back Questions and Answers, Notes.

Tamilnadu Samacheer Kalvi 12th Economics Solutions Chapter 9 Fiscal Economics

12th Economics Guide Fiscal Economics Text Book Questions and Answers

PART-A

Multiple Choice questions

Question 1.
The modern state is
a) Laissez-faire state
b) Aristocratic state
c) Welfare state
d) Police state
Answer:
c) Welfare state

Question 2.
One of the following is NOT a feature of private finance
a) Balancing of income and expenditure
b) Secrecy
c) Saving some part of income
d) Publicity
Answer:
d) Publicity

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 3.
The tax possesses the following characteristics
a) Compulsory
b) No quid pro quo
c) Failure to pay is offence
d) All the above
Answer:
d) All the above

Question 4.
Which of the following canons of taxation was not listed by Adam smith?
a) Canon of equality
b) Canon of certainty
c) Canon of convenience
d) Canon of simplicity
Answer:
d) Canon of simplicity

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 5.
Consider the following statements and identify the correct ones.
i. Central government does not have exclusive power to impose tax which is not mentioned in state or concurrent list.
ii.The Constitution also provides for transferring certain tax revenues from union list to states.
a) i only
b) ii only
c) both
d) none
Answer:
b) ii only

Question 6.
GST is equivalence of
a) Sales tax
b) Corporation tax
c) Income tax
d) Local tax
Answer:
a) Sales tax

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 7.
The direct tax has the following merits except
a) equity
b) convenient
c) certainty
d) civic consciousness
Answer:
b) convenient

Question 8.
Which of the following is a direct tax?
a) Excise duty
b) Income tax
c) Customs duty
d) Service tax
Answer:
b) Income tax

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 9.
Which of the following is not a tax under Union list?
a) Personal Income tax
b) Corporation tax
c) Agricultural Income tax
d) Excise duty
Answer:
c) Agricultural Income tax

Question 10.
” Revenue Receipts” of the government do not include
a) Interest
b) Profits and dividents
c) Recoveries and loans
d) Rent from property
Answer:
d) Rent from property

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 11.
The difference between revenue expenditure and revenue receipts is
a) Revenue deficit
b) Fiscal deficit
c) Budget deficit
d) primary deficit
Answer:
a) Revenue deficit

Question 12.
The difference between total expenditure and total receipts including loans and other liabilities is called
a) Fiscal deficit
b) Budget deficit
c) Primary deficit
d) Revenue deficit
Answer:
a) Fiscal deficit

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 13.
The primary purpose of deficit financing is
a) Economic development
b) Economic stability
c) Economic equality
d) Employment generation
Answer:
a) Economic development

Question 14.
Deficit budget means
a) An excess of government’s revenue over expenditure
b) An excess of government’s current expenditure over its current revenue
c) An excess of government’s total expenditure over its total revenue
d) None of above
Answer:
c) An excess of government’s total expenditure over its total revenue

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 15.
Methods of repayment of public debt is
a) Conversion
b) Sinking fund
c) Funded debt
d) All these
Answer:
d) All these

Question 16.
Conversion of public debt means exchange of
a) new bonds for the old ones
b) low interest bonds for higher interest bonds
c) Long term bonds for short term bonds
d) All the above
Answer:
b) low interest bonds for higher interest bonds

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 17.
The word budget has been derived from the French word ” bougette” which means
a) A small bag
b) An empty box
c) A box with papers
d) None of the aboye
Answer:
a) A small bag

Question 18.
Which one of the following deficits does not consider borrowing as a receipt?
a) Revenue deficit
b) Budgetary deficit
c) Fiscal deficit
d) Primary deficit
Answer:
c) Fiscal deficit

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 19.
Finance commission determines
a) The finances of Government of India
b) The resources transfer to the states
c) The resources transfer to the various departments
d) None of the above
Answer:
b) The resources transfer to the states

Question 20.
Consider the following statements and identify the right ones.
i. The finance commission is appointed by the president
ii. The tenure of finance commission is five years.
a) i only
b) ii only
c) both
d) none
Answer:
c) both

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

PART -B

Two Mark Questions

Question 21.
Define Public finance.
Answer:
Public finance is an investigation into the nature and principles of state revenue and expenditure. – Adam Smith

Question 22.
What is public revenue?
Answer:
Public Revenue:
Public revenue deals with the methods of raising public revenue such as tax and non-tax, the principles of taxation, rates of taxation, impact, incidence and shifting of taxes and their effects.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 23.
Differentiate tax and fee.
Answer:
A tax is a compulsory payment made to the government. But, there is no compulsion involved in the case of fees.

Question 24.
Write a short note on a Zero-based budget.
Answer:
Zero Base Budget:

  1. The Government of India presented Zero-Base-Budgeting (ZBB first) in 1987-88.
  2. It involves fresh evaluation of expenditure in the Government budget, assuming it as a new item.
  3. The review has been made to provide justification or otherwise for the project as a whole in the light of the socio-economic objectives which have been already set up for this project and as well as in view of the priorities of the society.

Question 25.
Give two examples for direct tax.
Answer:

  1. Income Tax
  2. Corporation Tax.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 26.
What are the components of GST?
Answer:

  • CGST – collected by the central government on an intrastate sale SGST – collected by the state government on an intrastate sale.
  • IGST – collected by the central government for interstate sale.

Question 27.
What do you mean by public debt?
Answer:

  1. The state has to supplement the traditional revenue sources with borrowing from individuals, and institutions within and outside the country.
  2. The amount of borrowing is huge in the underdeveloped countries to finance development activities.
  3. The debt burden is a big problem and most of the countries are in a debt trap.

PART -C

Three Mark Questions
Question 28.
Describe canons of Taxation.
Answer:
According to Adam Smith, there are four canons or maxims of taxation. They are as follows:
Canons of Taxation:

  1. Economical
  2. Equitable
  3. Convenient
  4. Certain
  5. (Efficient and Flexible)

1. Canon of Ability:

  • The Government should impose a tax in such a way that the people have to pay taxes according to their ability.
  • In such a case, a rich person should pay more tax compared to a middle-class person or a poor person.

2. Canon of Certainty:

  • The Government must ensure that there is no uncertainty regarding the rate of tax or the time of payment.
  • If the Government collects taxes arbitrarily, then these will adversely affect the efficiency of the people and their working ability too.

3. Canon of Convenience:

  • The method of tax collection and the timing of the tax payment should suit the convenience of the people.
  • The Government should make convenient arrangements for all the taxpayers to pay the taxes without difficulty.

4. Canon of Economy:

  • The Government has to spend money for collecting taxes, for example, salaries are given to the persons who are responsible for collecting taxes.
  • The taxes, where collection costs are more are considered bad taxes.
  • Hence, according to Smith, the Government should impose only those taxes whose collection costs are very less and cheap.

Question 29.
Mention any three similarities between public finance and private finance.
Answer:

  1. Rationality: Both public finance and private finance are based on rationality. Maximization of welfare and least cost factor combination underlie both.
  2. Limit to borrowing: Both have to apply restraint with regard to borrowing. There is a limit to deficit financing by the state also.
  3. Resource utilization: Both the private and public sectors have limited resources at their disposal and make optimum use of it.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 30.
What are the functions of a modern state?
Answer:
The functions of a modem state are.

  • Defense – To protect the people
  • Judiciary – Rendering Justice and settlement of disputes
  • Enterprises – Regulation and control of the private enterprise
  • Social welfare – provision of social goods.
  • Infrastructure – Creating social and economic infrastructure
  • Macroeconomic policy
  • Social Justice – Redistribution of income
  • Control of monopoly

Question 31.
State any three characteristics of taxation.
Answer:
Characteristics of Tax:

  1. A tax is a compulsory payment made to the government. People on whom a tax is imposed must pay the tax. Refusal to pay the tax is a punishable offense.
  2. There is no quid pro quo between a taxpayer and public authorities. This means that the taxpayer cannot claim any specific benefit against the payment of a tax.
  3. Every tax involves some sacrifice on part of the taxpayer.
  4. A tax is not levied as a fine or penalty for breaking the law.

Question 32.
Point out any three differences between direct tax and indirect tax.
Answer:

Direct Tax

Indirect Tax

1. progressive tax Regressive tax
2. Tax evasion is possible Tax evasion is hardly possible
3. cannot be shifted cannot be shifted

Question 33.
What is the primary deficit?
Answer:
Primary Deficit:

  1. Primary deficit is equal to fiscal deficit minus interest payments.
  2. It shows the real burden of the government and it does not include the interest burden on loans taken in the past.
  3. Thus, primary deficit reflects the borrowing requirement of the government exclusive of interest payments.
  4. Primary Deficit (PD) = Fiscal deficit (PD) – Interest Payment (IP)

Question 34.
Mention any three methods or redemption of public debt.
Answer:

  1. Budgetary surplus: When the government presents a surplus budget, it can be utilized for repaying the debt.
  2. Terminal Annuity: In this method, the government pays off the public debt on the basis of terminal annuity in equal annual installments.
  3. Reduction in Rate of Interest: Another method of debt redemption is the compulsory reduction in the rate of interest, during the time of financial crisis.

PART – D

Five Mark Questions

Question 35.
Explain the scope of public finance.
Answer:
In modern times, the subject ‘Public Finance includes five major subdivisions, they are

  • Public Revenue:
    Public revenue deals with the methods of raising public revenue such as tax and non-tax, the principles of taxation, rates of taxation, impact, incidence and shifting of taxes and their effects.
  • Public Expenditure:
    This part studies the fundamental principles that govern government expenditure, effects of public expenditure, and control of public expenditure.
  • Public Debt:
    Public debt deals with the methods of raising loans from internal and external sources. The burden, effects, and redemption of public debt fall under this head.
  • Financial Administration:
    This part deals with the study of the different aspects of public budget. The budget is the Annual master financial plan of the government.
  • Fiscal policy:
    Taxes, Subsidies, public debt and public expenditure are the instruments of fiscal policy.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 36.
Bring out the merits of indirect taxes over direct taxes.
Answer:
Merits of Direct Taxes:
(I) Equity:

  1. Direct taxes are progressive i.e. rate of tax varies according to tax base.
  2. For example, income tax satisfies the canon of equity.

(II) Certainty:

  1. Canon of certainty can be ensured by direct taxes.
  2. For example, an income tax payer knows when and at what rate he has to pay income tax.

(III) Elasticity:

  1. Direct taxes also satisfy the canon of elasticity.
  2. Income tax is income elastic in nature. As income level increases, the tax revenue to the Government also increases automatically.

(IV) Economy:

  1. The cost of collection of direct taxes is relatively low.
  2. The tax payers pay the tax directly to the state.

Merits of Indirect Taxes:

(I) Wider Coverage:

  1. All the consumers, whether they are rich or poor, have to pay indirect taxes.
  2. For this reason, it is said that indirect taxes can cover more people than direct taxes.
  3. For example, in India everybody pays indirect tax as against just 2 percent paying income tax.

(I) Equitable:
The indirect tax satisfies the canon of equity when higher tax is imposed on luxuries used by rich people.

(II) Economical:

  1. Cost of collection is less as producers and retailers collect tax and pay to the Government.
  2. The traders act as honorary tax collectors.

(IV) Checks harmful consumption:

  1. The Government imposes indirect taxes on those commodities which are harmful to health
  2. e.g. tobacco, liquor etc.
  3. They are known as sin taxes.

(V) Convenient:

  1. Indirect taxes are levied on commodities and services.
  2. Whenever consumers make a purchase, they pay tax along with the price.
  3. They do not feel the pinch of paying tax.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 38.
State and Explain instruments of fiscal policy:
Answer:
Fiscal policy is implemented through fiscal instruments also called’ fiscal tools’ or fiscal levers.

1. Taxation:
Taxes transfer income from the people to the Government. Taxes are either direct or indirect. An increase in tax reduces disposable income. So taxation should be raised to control inflation. During the depression, taxes are to be reduced.

2. Public Expenditure:
Public expenditure raises wages and salaries of the employees and thereby the aggregate demand for goods and services. Hence public expenditure is raised to fight recession and reduced to control inflation.

3. Public debt:
When government borrows by floating a loan, there is transfer of funds from the public to the Government At the time of interest payment and repayment of public debt, funds are transferred from Government to public.

Question 39.
Explain the principles of federal finance.
Answer:
Principles of Federal Finance:
In the case of a federal system of finance, the following main principles must be applied:

  1. Principle of Independence.
  2. Principle of Equity.
  3. Principle of Uniformity.
  4. Principle of Adequacy.
  5. Principle of Fiscal Access.
  6. Principle of Integration and coordination.
  7. Principle of Efficiency.
  8. Principle of Administrative Economy.
  9. Principle of Accountability.

1. Principle of Independence:
(i) Under the system of federal finance, a Government should be autonomous and free about the internal financial matters concerned.

(ii) It means each Government should have separate sources of revenue, authority to levy taxes, to borrow money and to meet the expenditure.

3. The Government should normally enjoy autonomy in fiscal matters.

2. Principle of Equity:
From the point of view of equity, the resources should be distributed among the different states so that each state receives a fair share of revenue.

3. Principle of Uniformity:
In a federal system, each state should contribute equal tax payments for federal finance.

4. Principle of Adequacy of Resources:

  1. The principle of adequacy means that the resources of each Government i.e. Central and State should be adequate to carry out its functions effectively.
  2. Here adequacy must be decided with reference to both current as well as future needs.
  3. Besides, the resources should be elastic in order to meet the growing needs and unforeseen expenditure like war, floods etc.

5. Principle of Fiscal Access:
(i) In a federal system, there should be possibility for the Central and State Governments to develop new source of revenue within their prescribed fields to meet the growing financial needs.

(ii) In nutshell, the resources should grow with the increase in the responsibilities of the . Government.

6. Principle of Integration and coordination:

  1. The financial system as a whole should be well integrated.
  2. There should be perfect coordination among different layers of the financial system of the country.
  3. Then only the federal system will survive.
  4. This should be done in such a way to promote the overall economic development of the country.

7. Principle of Efficiency:

  1. The financial system should be well organized and efficiently administered.
  2. Double taxation should be avoided.

8. Principle of Administrative Economy:

  1. Economy is the important criterion of any federal financial system.
  2. That is, the cost of collection should be at the minimum level and the major portion of revenue should be made available for the other expenditure outlays of the Governments.

9. Principle of Accountability:
Each Government should be accountable to its own legislature for its financial decisions i.e. the Central to the Parliament and the State to the Assembly.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 40.
Describe the various types of deficit in budget.
Answer:
1. Revenue Deficit:
It refers to the excess of the government revenue expenditure over revenue re
ceipts. It does not consider capital receipts and capital expenditure. Revenue deficit implies that the government is living beyond its means to conduct day- today operations.
Revenue deficit (RD) =
Total Revenue Expenditure (RE) – Total Revenue Receipts (RR)
When RE – RR >0

2. Budget Deficit:
Budget deficit is the difference between total receipts and total expenditure.
Budget deficit = Total Expenditure – Total Revenue

3. Fiscal deficit ,
Fiscal deficit (FD) =
Budget deficit + Governments Market borrowing and liabilities.

4. Primary deficit:
Primary deficit = Fiscal deficit (FD) – Interest payment (IP)
It shows the real burden of the government and it does not include the interest burden on loans taken in the past. Thus, primary deficit reflects borrowing requirement of the government exclusive of interest payment.

Question 41.
What are the reasons for the recent growth in public expenditure?
Answer:
Causes for the Increase in Government Expenditure:
The modem state is a welfare state. In a welfare state, the government has to perform several functions viz Social, economic and political. These activities are the cause for increasing public expenditure.

(I) Population Growth:
1. During the past 67 years of planning, the population of India has increased from 36.1 crore in 1951, to 121 crore in 2011.

2. The growth in population requires massive investment in health and education, law and order, etc.

3. Young population requires increasing expenditure on education & youth services, whereas the aging population requires transfer payments like old age pension, social security & health facilities.

(II) Defence Expenditure:

  1. There has been enormous increase in defence expenditure in India during planning period.
  2. The defence expenditure has been increasing tremendously due to modernisation of defence equipment.
  3. The defence expenditure of the government was 10,874 crores in 1990-91 which increased significantly to 2,95,511 crores in 2018-19.

(III) Government Subsidies:
1. The Government of India has been providing subsidies on a number of items such as food, fertilizers, interest on priority sector lending, exports, education, etc.

2. Because of the massive amounts of subsidies, public expenditure has increased manifold.

(IV) Debt Servicing:
The government has been borrowing heavily both from internal and external sources, As a result, the government has to make huge amounts of repayment towards debt servicing.

(V) Development Projects:
1. The government has been undertaking various development projects such as irrigation, iron and steel, heavy machinery, power, telecommunications, etc.

2. The development projects involve huge investments.

(VI) Urbanisation:

  1. There has been an increase in urbanization.
  2. In 1950 – 51 about 17% of the population was urban-based.
  3. Now the urban population has increased to about 43%.
  4. There are more than 54 cities above one million population.
  5. The increase in urbanization requires heavy expenditure on law and order, education and civic amenities.

(VII) Industrialisation:

  1. Setting up of basic and heavy industries involves a huge capital and long gestation period.
  2. It is the government which starts such industries in a planned economy.
  3. The underdeveloped countries need a strong infrastructure like transport, communication, power, fuel, etc.

(VIII) Increase in grants in aid to state and union territories:
There has been a tremendous increase in grant-in-aid to state and union territories to meet natural disasters.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

12th Economics Guide Fiscal Economics Additional Important Questions and Answers

I. Choose the best Answer

Question 1.
“Public finance is one of those subjects that lie on the borderline between Economics and ……………………….
(a) Finance
(b) Investment
(c) Politics
(d) Money
Answer:
(c) Politics

Question 2.
…………… includes Public Revenue, Expenditure, Debt and Financial Administration.
a) Public Expenditure
b) Public Revenue
c) Public Finance
d) Public Debt
Answer:
c) Public Finance

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 3.
The compulsory charge levied by the government is ……………………….
(a) Tax
(b) Loan
(c) Licence
(d) Gifts and grants
Answer:
(a) Tax

Question 4.
As per the 2011 census, the population of India is …………..crore’
a) 112
b) 121
c) 211
d) 36.7
Answer:
b) 121

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 5.
………………………. means different sources of government income.
(a) Public finance
(b) Public revenue
(c) Public expenditure
(d) Public credit
Answer:
(b) Public revenue

Question 6.
………………… is a compulsory payment by the citizens to the government to meet the public expenditure.
a) Revenue
b) Tax
c) Debt
d) None of the above
Answer:
b) Tax

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 7.
The revenue obtained by the government from sources other than tax is called
a) Non – Tax Revenue
b) Tax
c) Debt
d) Income tax
Answer:
a) Non – Tax Revenue

Question 8.
………………………. deals with the study of income, expenditure, borrowing, and financial administration of the government.
(a) Public Finance
(b) Public Revenue
(c) Public Expenditure
(d) Public Debt
Answer:
(a) Public Finance

Question 9.
The process of repaying a public debt is called …………………
a) Sinking fund
b) Conversion
c) Redemption
d) Annuity
Answer:
c) Redemption

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 10.
The modem state is a state.
(a) Revenue
(b) Defence
(c) Government
(d) Welfare
Answer:
(d) Welfare

Question 11.
The Government of India presented Zero – Base Budgeting in …………
a) 1987 -88
b) 1986 – 87
c) 1950 – 51
d) 1978 – 79
Answer:
a) 1987 – 88

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 12.
In ………………….. budget, the estimated government expenditure is more than expected revenue.
a) Surplus
b) Balanced
c) Deficit
d) Performance
Answer:
c) Deficit

Question 13.
The first finance commission was set up in ……………………
a) 1950
b) 1951
c) 1956
d) 1960
Answer:
b) 1951

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 14.
…………………….. such as irrigation, iron and steel, heavy machinery, power, telecommunications, etc.
(a) Development projects
(b) Investment projects
(c) Finance project
(d) Monetary projects
Answer:
(a) Development projects

Question 15.
The rate of tax increases with the increase in the tax base
a) Regressive tax
b) Progressive tax
c) Direct tax
d) Indirect tax
Answer:
b) Indirect tax

Question 16.
……………………….. is an Indirect tax levied on the supply of goods and services.
(a) Direct Tax
(b) Regressive Tax
(c) GST
(d) Progressive Tax
Answer:
(c) GST

Question 17.
………………………… institutions like UTI, LIC, GIC, etc. also buy the Government bonds.
(a) Financial
(b) Non – Financial
(c) Government
(d) Private
Answer:
(a) Financial

II. Match the following.

Question 1.
A) Public finance – 1) Tax for tax
B) Tax – 2) Fiscal Economics
C) Cess – 3) GST
D) Indirect tax – 4) Compulsory payment
Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics 1
Answer:
b) 2 3 1 4

Question 2.
A) GST – 1) a small leather Bag
B) VAT – 2) Quasi-judicial Body
C) Bougett – 3) Goods and services tax
D) Finance commission – 4) Value Added Tax
Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics 1
Answer:
c) 3 4 12

Question 3.
A) Panchayat – 1) Keynes
B) District Boards – 2) Adam smith
C) New Economics – 3) Revenue village
D) Canons of Taxation – 4) Zila Parishad
Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics 4
Answer :
a) 3 4 12

III. Choose the Correct Pair:

Question 1.
a) Article 282 – Finance commission
b) 15th Finance commission – November 2018
c) State Tax – Customs Tax
d) Central Government Tax – Income tax
Answer:
d) Central Government Tax – Income tax

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 2.
a) Balanced Budge – Government Income > Expenditure
b) Performance Budget – Outcome Budget
c) Supplementary Budget – Lame-duck budget
d)Bougett – a small box
Answer:
b) Performance Budget – Outcome Budget

Question 3.
a) Sinking Fund – Walpole
b) Debt conversion – J.M. Keynes
c) Article 112 – State Budget
d) Article 202 – Union Budget
Answer:
a) Sinking Fund – Walpole

IV. Choose the Incorrect Pair:

Question 1.
a) CGST – Collected by the Central Government
b) SGST – Collected by the state Government
c) IGST – Collected by both central and state Government
d) GST – Indirect tax
Answer:
c) IGST – Collected by both central and state Government

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 2.
a) Revenue Deficit Total Revenue Expenditure – Total Revenue Receipts
b) Budget Deficit Total Expenditure – Total Revenue
c) Fiscal Deficit Budget deficit + Government‘s market borrowings and liabilities.
d) Primary Deficit – Fiscal Deficit + Interest Payment
Answer:
d) Primary Deficit Fiscal Deficit + Interest Payment

Question 3.
a) Article 269 – Taxes levied and collected by the union but Assigned to the states.
b) Article 268 – Duties levied by the Union but collected and appropriated by the states. .
c) Article 270 – Taxes which are levied, collected, and appropriated by the union.
d) Article 280 – Functions of the Finance committee.
Answer:
c) Article 270- Taxes which are levied, collected, and appropriated by the union.

V. Choose the Correct Statement:

Question 1.
a) Public finance and private finance are similar in operational aspects.
b) “Public finance is an investigation into the nature and principles of the state revenue and expenditure” – Huge Dalton.
c) The Government of India presented Zero – Base – Budgeting in 1987 – 88.
d) Direct taxes are levied on goods and services.
Answer:
c) The Government of India presented Zero – Base – Budgeting in 1987 – 88.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 2.
a) Direct tax is levied on a person’s income and wealth.
b) Direct taxes are regressive in nature.
c) In Indirect tax, the tax burden can be easily shifted to another person.
d) Direct tax is imposed on those commodities which are harmful to health.
Answer:
a) Direct tax is levied on a person’s income and wealth.

Question 3.
a) GST – Central Goods and service tax
b) CGST – Goods and Service Tax
c) SGST – State Goods and Service Tax
d) IGST – Union Territory Goods and Service Tax
Answer :
c) SGST – State Goods and Service Tax

VI. Choose the Incorrect Statement:

Question 1.
a) Taxes on commodities like tobacco, liquor, etc is called sintax.
b) VAT is a one-point tax without cascading effect.
c) Revenue expenditure is classified as plan revenue expenditure and non-plan revenue expenditure.
d) According to the Indian constitution, all money bills must be initiated in the Lower House.
Answer:
b) VAT is a one-point tax without cascading effect.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 2.
a) Revenue deficit is equal to fiscal deficit minus interest payments.
b) Local finance refers to the finance of local bodies in India.
c) During the depression, the Government, increase its spending and reduce taxation.
d) Progressive rates in taxation help to reduce the gap between rich and poor
Answer:
a) Revenue deficit is equal to fiscal deficit minus interest payments.

Question 3.
a) Fluctuations in international trade cause movements in the exchange rate.
b) Taxation reduces disposable income and so aggregate demand.
c) Dalton emphasized government intervention to get the economies out of the Depression.
d) Government expenditure, taxation, and borrowing are the fiscal tools.
Answer:
c) Dalton emphasized government intervention to get the economies out of the Depression.

VII. Pick the odd one out:

Question 1.
a) Canon of Ability
b) Canon of flexibility,
c) Canon of certainty
d) Canon of Economy
Answer:
b) Canon of flexibility

Question 2.
a) Public revenue
b) Public expenditure
c) Financial Administration
d) Social Justice
Answer:
d) Social Justice

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 3.
The characteristics of Direct Tax are:
a) Progressive in nature.
b) Incidence and impact on different person.
c) Tax Evasion is possible
d) Helps to control inflation.
Answer:
b) Incidence and impact on different person.

VIII. Choose the Incorrect Statement:

Question 1.
Assertion (A): Dalton says under indirect taxes 2 + 2 is not 4 but 3 or even less than 3.
Reason (R): The rise in indirect taxes increases the price and reduces the demand for goods. Therefore the Government is uncertain about the expected revenue collection.
Answer:
a) Assertion (A) and Reason (R) both are true, and (R) is the correct explanation of (A).

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 2.
Assertion (A): Tax is a compulsory payment by the citizens to the government to meet the public expenditure.
Reason (R): It is legally imposed by the government on the taxpayer and in no case, taxpayer can refuse to pay taxes to the government.
Answer:
a) Assertion (A) and Reason (R) both are true, and (R) is the correct explanation of (A).
Option:
a) Assertion (A) and Reason (R) both are true, and (R) is the correct explanation of (A).
b) Assertion (A) and Reason (R) both are true but (R) is the correct explanation of (A).
c) Both (A) and (R) are false.
d) (A) is true but (R) is false.

IX. Two Mark Questions

Question 1.
What do you mean by Public Finance?
Answer:

  1. Public finance is a study of the financial aspects of Government.
  2. It is concerned with the revenue and expenditure of the public authorities and with the adjustment of the one to the other.

Question 2.
What is Private finance?
Answer:
Private finance is the study of income, expenditure, borrowing, and financial administration of individual or private companies.
Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 3.
Define “Public Expenditure”?
Answer:
Public expenditure can be defined as, “The expenditure incurred by public authorities like central, state and local governments to satisfy the collective social wants of the people is known as public expenditure”.

Question 4.
Name the classification of Public Revenue.
Answer:
Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics 5

Question 5.
What is the classification of Public Revenue?
Answer:
Public revenue can be classified into two types.

  1. Tax Revenue
  2. Non-Tax Revenue

Question 6.
What are the canons or maxims of taxation?
Answer:

  • Economical
  • Equitable
  • Convenient
  • Certain
  • Efficient and Flexible.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 7.
Define “Tax Revenue”?
Answer:
1. “A Tax is a compulsory payment made by a person or a firm to a government without reference to any benefit the payer may derive from the government.” – Anatol Murad

2. “A Tax is a compulsory contribution imposed by public authority, irrespective of the exact amount of service rendered to the taxpayer in return and not imposed as a penalty for any legal offense.” – Dalton

Question 8.
Name some of the types of Indirect Taxes.
Answer:

  1. Excise Duty
  2. Sales Tax
  3. Custom Duty
  4. Entertainment Tax
  5. Service Tax.

Question 9.
State the merits and demerits of Indirect Taxes.
Answer:
Merits:

  1. Wider coverage
  2. Equitable
  3. Economical
  4. Checks harmful consumption

Demerits:

  1. The higher cost of collection
  2. Inelastic
  3. Regressive
  4. Uncertainty
  5. No civic consciousness.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 10.
Sate the nature of sales tax, VAT, and GST.
Answer:

  • Sales Tax: Multipoint tax with cascading effect.
  • VAT: Multipoint tax without cascading effect.
  • GST: One point tax without cascading effect.

Question 11.
Mention any two advantages of GST.
Answer:

  1. GST removes the cascading effect on the sale of goods and services.
  2. GST is also mainly technologically driven. All the activities are done online on the GST portal. This will speed up the processes.

Question 12.
Define Public Debt.
Answer:
“The Debt is the form of promises by The Treasury to pay to the holders of these promises a principal sum and in most instances interest on the principal. Borrowing resorts in order to provide funds for financing a current deficit” – Philip E. Taylor.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 13.
What are the types of Public Debt?
Answer:

  1. Internal Public Debt.
  2. External Public Debt.

Question 14.
What are the sources of internal public debt?
Answer:

  • Individuals who purchase government bonds and securities.
  • Banks, both public and private, buy bonds from the Government.
  • Non-financial institutions like UTI, LIC, GIC, etc. also buy the Government bonds
  • The central banks can lend to the Government in the form of the money supply.
  • The Central Bank can also issue money to meet the expenditures of the Government.

Question 15.
State the causes for the increase in public debt.
Answer:

  • War and preparation of war.
  • Social obligations
  • Economic Development and Deficit
  • Employment
  • Controlling inflation
  • Fighting depression.

Question 16.
Name the types of budgets.
Answer:

  1. Revenue Budget
  2. Capital Budget
  3. Supplementary Budget
  4. Vote-on-Account
  5. Zero Base Budget
  6. Performance Budget <
  7. Balanced and Unbalanced Budget.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 17.
What is a Budget Balanced?
Answer:
A balanced Budget is a situation, in which the estimated revenue of the government during the year is equal to its anticipated expenditure.

Question 18.
What is an Unbalanced budget?
Answer:
The budget in which Revenue and Expenditure are not equal to each other is known as an unbalanced budget.

  1. Surplus Budget – the estimated revenues of the year are greater than anticipated expenditures.
  2. Deficit Budget – the estimated government expenditure is more than expected revenue.

Question 19.
What are Budgetary procedures?
Answer:

  • Preparation of the Budget
  • Presentation of the Budget
  • Execution of the Budget.

Question 20.
What is the method of maintaining Government Accounts in India?
Answer:

  • Consolidated Fund
  • Contingency Fund
  • Public Accounts

Question 21.
Name the parliamentary committees that control budget accounts.
Answer:

  1. The Public Accounts Committee
  2. The Estimates Committee.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 22.
Name the types of Local Bodies.
Answer:

  1. Village panchayats
  2. District Boards or Zila Parishad
  3. Municipalities
  4. Municipal corporations.

Question 23.
What are the sources of revenue of village panchayats?
Answer:

  • general property tax
  • taxes on land
  • profession tax
  • tax on animals and vehicles.

Question 24.
What are the sources of revenue of District Boards?
Answer:

  • Grants – in – aid from the state government
  • Land cesses
  • Toll fees etc.
  • Income from the property and loans from the state governments
  • Grants for the centrally sponsored schemes relating to development work.
  • Income from fairs and exhibitions.
  • Property tax and other taxes which the state governments may authorize the district boards.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 25.
What are the sources of revenue of municipalities?
Answer:

  • Taxes on property
  • Taxes on goods, particularly octroi and terminal tax.
  • personal taxes, taxes on profession, trades, and employment
  • taxes on vehicles and animals
  • theatre or show tax
  • grants – in – aid from the state government.

Question 26.
State the sources of revenue of corporations.
Answer:

  •  tax on property
  • tax on vehicles and animals
  • tax on trades, calling, and employment
  • theatre and show tax
  • taxes on goods brought into the cities for sale
  • taxes on advertisements
  • octroi and terminal tax.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 27.
Define Fiscal policy.
Answer:
“By fiscal policy is meant the use of public finance or expenditure, taxes, borrowing, and financial administration to further our national economic objectives.” – Buehler.

Question 28.
What are the objectives of Fiscal policy?
Answer:

  • Full employment
  • Price stability
  • Economic growth
  • Equitable distribution
  • External stability
  • Capital formation
  • Regional balance.

Question 29.
What is a lame-duck budget?
Answer:
The existing Government may or may not continue for the year on account of the fact that elections are due, then the Government places a ‘lame duck budget’. This is also called ‘ vote-on-account Budget’.

Question 30.
What is the share taxes between central and state Government?
Answer:

  • Share to State Governments – 42%
  • Share to Central Government – 58%
  • 50% of GST collection is given to State Governments.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 31.
What is Goods and Services tax?
Answer:
Goods and Service Tax is an indirect tax levied on the supply of goods and services.

Question 32.
What are Progressive and Regressive taxes?
Answer:
Progressive Tax: The rate of tax increases with the increase in the tax base.
Regressive Tax: High rate of tax is levied on the poor and a low rate is levied on the rich.

Question 33.
What are the functions of the Finance Commission of India?
Answer:

  1. The distribution between the union and the states of the net proceeds of taxes, which may be divided between them and the allocation among the states of the respective shares of such proceeds.
  2. To determine the quantum of grants – in – aid to be given by the center to states and to evolve the principles governing the eligibility of the state for such grant – in – aid.
  3. Several issues like debt relief, financing of calamity relief of states, additional excise duties, etc., have been referred to the commission invoking this clause.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

X. 5 Mark Questions

Question 1.
What are the similarities between Public and Private Finance?
Answer:
(I) Rationality:

  1. Both public finance and private finance are based on rationality.
  2. Maximization of welfare and least cost factor combination underlie both.

(II) Limit to borrowing:

  1. Both have to apply restraint with regard to borrowing.
  2. The Government also cannot live beyond its means.
  3. There is a limit to deficit financing by the state also.

(III) Resource utilisation:

  1. Both the private and public sectors have limited resources at their disposal.
  2. So both attempt to make optimum use of resources.

(IV) Administration:

  1. The effectiveness of measures of the Government as well as private depends on the administrative machinery.
  2. If the administrative machinery is inefficient and corrupt it will result in wastages and losses.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Question 2.
Explain the sources of tax revenue of the State Government.
Answer:

  • Capitation tax
  • Duties in respect of succession to agricultural land.
  • Duties of excise on certain goods produced or manufactured in the state such as alcoholic, liquids, opium, etc.,
  • Estate duty in respect of agricultural land.
  • Fees in respect of any of the matters in the state list, but not including fees taken in any court.
  • Land Revenue.
  • Rates of the stamp duty in respect of documents other than those specified in the union list.
  • Taxes on Agricultural income.
  • Taxes on land and buildings.
  • Taxes on mineral rights, subject to limitations imposed by parliament relating to mineral development.
  • Taxes on the consumption or sale of electricity.
  • Taxes on the entry of goods into a local area for consumption use or sale therein.
  • Taxes on the sale and purchase of goods other than newspapers.
  • Taxes on the advertisements other than those published in newspapers.
  • Taxes on vehicle
  • Taxes on animals and boats.
  • Tolls.

Question 3.
Explain the sources of Non-Tax Revenue?
Answer:
The sources of non-tax revenue are:
(I) Fees:

  1. Fees are another important source of revenue for the government.
  2. A fee is charged by public authorities for rendering a service to the citizens.
  3. Unlike a tax, there is no compulsion involved in the case of fees.
  4. The government provides certain services and charges certain fees for them.
  5. For example, fees are charged for issuing passports, driving licenses, etc.

(II) Fine:

  1. A fine is a penalty imposed on an individual for violation of the law.
  2. For example, violation of traffic rules, payment of income tax after the stipulated time, etc.

(III) Earnings from Public Enterprises:

  1. The Government also gets revenue by way of surplus from public enterprises.
  2. Some of the public sector enterprises do make a good amount of profits.
  3. The profits or dividends which the government gets can be utilized for public expenditure.

(IV) Special assessment of betterment levy:
1. It is a kind of special charge levied on certain members of the community who are beneficiaries of certain government activities or public projects.

2. For example, due to a public park or due to the construction of a road, people in that locality may experience an appreciation in the value of their property or land.

(V) Gifts, Grants, and Aids:

  1. A grant from one government to another is an important source of revenue in the modem days.
  2. The government at the Centre provides grants to State governments and the State governments provide grants to the local government to carry out their functions.
  3. Grants from foreign countries are known as Foreign Aid.
  4. Developing countries receive military aid, food aid, technological aid, etc. from other countries.

(VI) Escheats:
It refers to the claim of the state to the property of persons who die without legal heirs or documented will.

Samacheer Kalvi 12th Economics Guide Chapter 9 Fiscal Economics

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Computer Science Guide Pdf Chapter 10 Python Classes and Objects Text Book Back Questions and Answers, Notes.

Tamilnadu Samacheer Kalvi 12th Computer Science Solutions Chapter 10 Python Classes and Objects

12th Computer Science Guide Python Classes and Objects Text Book Questions and Answers

I. Choose the best answer (1 Marks)

Question 1.
Which of the following are the key features of an Object Oriented Programming language?
a) Constructor and Classes
b) Constructor and Object
c) Classes and Objects
d) Constructor and Destructor
Answer:
c) Classes and Objects

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 2.
Functions defined inside a class:
a) Functions
b) Module
c) Methods
d) section
Answer:
c) Methods

Question 3.
Class members are accessed through which operator?
a) &
b) .
c) #
d) %
Answer:
b) .

Question 4.
Which of the following method is automatically executed when an object is created?
a) _object _()
b) _del_()
c) _func_ ()
d) _init_ ()
Answer:
d) _init_ ()

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 5.
A private class variable is prefixed with
a) _
b) &&
c) ##
d) **
Answer:
a) _

Question 6.
Which of the following method is used as destructor?
a) _init_ ()
b) _dest_ ()
c) _rem_ ()
d) _del_ ()
Answer:
d) del ()

Question 7.
Which of the following class declaration is correct?
a) class class_name
b) class class_name<>
c) class class_name:
d) class class_name[ ]
Answer:
c) class class_name:

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 8.
Which of the following is the output of the following program?
class Student:
def_init_(self, name):
self.name=name
print(self.name)
S=Student(“Tamil”)
a) Error
b) Tamil
c) name
d) self
Answer:
b) Tamil

Question 9.
Which of the following is the private class variable?
a) num
b) ##num
c) $$num
d) &&num
Answer:
a) num

Question 10.
The process of creating an object is called as:
a) Constructor
b) Destructor
c) Initialize
d) Instantiation
Answer:
d) Instantiation

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

II. Answer the following questions (2 Marks)

Question 1.
What is the class?
Answer:
Classes and Objects are the key features of Object-Oriented Programming. Class is the main building block in Python. The object is a collection of data and functions that act on those data. Class is a template for the object. According to the concept of Object-Oriented Programming, objects are also called instances of a class or class variable.

Question 2.
What is instantiation?
Answer:
The process of creating an object is called “Class Instantiation”.
Syntax:
Object_name = class_name()

Question 3.
What is the output of the following program?
Answer:
class Sample:
_num=10
def disp(self):
print(self._num)
S=Sample( )
S.disp( )
print(S._num)
Output:
Error: Sample has no attribute S._num
10

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

RESTART:
C:/ Users/ COMPUTER / AppData / Local/ Programs / Python / Py thon37-32/ tst.py
Traceback (most recent call last):
File “C:/Users/COMPUTER/ AppData/ Local / Programs / Python/ Python37-32/ tst.py”, line
6, in <module>
S.disp()
AttributeError: ‘Sample’ object has no attribute ‘disp’
>>>

Question 4.
How will you create a constructor in Python?
Answer:

  • In Python, there is a special function called “init” which acts as a Constructor.
  • It must begin and end with a double underscore.
  • This function will act as an ordinary function; but the only difference is, it is executed automatically when the object is created.
  • This constructor function can be defined with or without arguments.
  • This method is used to initialize the class variables.

General format of _init_method (Constructor function):
def _init_(self, [args………… ]):
< statements >

Question 5.
What is the purpose of Destructor?
Answer:
Destructor is also a special method gets executed automatically when an object exit from the scope. It is just the opposite to the constructor. In Python, _del_( ) method is used as the destructor.

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

III. Answer the following questions (3 Marks)

Question 1.
What are class members? How do you define it?
Answer:
In Python, a class is defined by using the keyword class. Every class has a unique name followed by a colon ( : ).
Syntax:
class class_name:
statement_1
statement_2
…………………
…………………
statement_n
Where, a statement in a class definition may be a variable declaration, decision control, loop or even a function definition. Variables defined inside a class are called as “Class Variable” and functions are called as “Methods”. Class variables and methods are together known as members of the class. The class members should be accessed through objects or instance of class. A class can be defined anywhere in a Python program.
Example:
Program to define a class
class Sample:
x, y = 10, 20 # class variables
In the above code, name of the class is Sample and it has two variables x and y having the initial value 10 and 20 respectively. To access the values defined inside the class, you need an object or instance of the class.

Question 2.
Write a class with two private class variables and print the sum using a method.
Answer:
Class with two private class variables and print the sum using a method:
class add:
def_init_(self,m,n):
self. _m=m
self. _n=n # m,n, – private variables
def display (self):
sum=self. m+self. n
print(‘ Enter first number=’,self. m,)
print(‘Enter second number=’,self. n)
print(“The sum is”,sum)
x=add(15,2)
x. display ()
Output:
>>>
RESTART: C:/Users/Computer/
AppData /Local/ Programs / Python /
Py thon3 7 / TW OLOC AL. py
Enter first number= 15
Enter second number= 2
The sum is 17
>>>

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 3.
Find the error in the following program to get the given output?
class Fruits:
def_init_(self, f1, f2):
self.f1=f1
self.f2=f2
def display (self):
print(“Fruit 1 = %s, Fruit 2 = %s” %(self.fl, self.f2))
F = Fruits (‘Apple’, ‘Mango’)
del F.display
F.display( )
Output
Fruit 1 = Apple, Fruit 2 = Mango
Answer:
In line No. 8, del F.display will not come

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 4.
What is the output of the following program?
Answer:
class Greeting:
def _init_ (self, name):
self. _name = name
def display(self):
print(“Good Morning “, self. _name)
obj=Greeting (‘BinduMadhavan’)
obj. display ()
Output:
Good Morning BinduMadhavan

Question 5.
How do define constructor and destructor in Python?
Answer:
Constructor:

  • The constructor is the special function that is automatically executed when an object of a class is created.
  • In Python, there is a special function called “init” which act as a Constructor.
  • It must begin and end with double underscore.
  • This function will act as an ordinary function; but the only difference is, it is executed automatically when the object is created.
  • This constructor function can be defined with or without arguments. This method is used to initialize the class variables.

Syntax:
_init_ method (Constructor function)
def _init_(self, [args …. ]):
< statements >

Example:
class Sample:
def _init_(self, num):
print(” Constructor of class Sample…”)
self.num=num
print(“The value is :”, num)
S=Sample(10)

Destructor:

  • Destructor is also a special method gets executed automatically when an object exit
  • from the scope.
  • It is just opposite to the constructor.
  • In Python, _del_ () method is used as the destructor.

Example:
class Example:
def _init_ (self):
print “Object created”
# destructor
def _del_ (self):
print “Object destroyed”
# creating an object
myObj = Example ()
Output:
Object created
Object destroyed

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

IV. Answer the following questions (5 Marks)

Question 1.
Write a menu-driven program to add or delete stationery items. You should use I dictionary to store items and the brand.
Answer:
stationary = { }
while((ch == 1) or (ch == 2))
print(” 1. Add Item \n 2. Delete Item”)
ch = int(input(“Enter your choice “))
if(ch==1):
n = int(input(“Enter the number of items to be added in the stationary shop”))
for i in range(n):
item = input(“Enter an item “)
brand = input(“Enter the brand Name”)
stationary[item] = brand
print(stationary)
elif(ch == 2):
remitem = input(“Enter the item to be deleted from the shop”)
dict.pop(remitem)
print( stationary)
else:
print(“Invalid options. Type 1 to add items and 2 to remove items “)
ch = int(input(“Enter your choice :”)
Output:

  1. Add item
  2. Delete Item Enter your choice : 1

Enter the number of items to be added in the stationary shop : 2
Enter an item : Pen
Enter the brand Name : Trimax
Enter an item: Eraser
Enter the brand Name: Camlin
Pen: Trimax
Eraser: Camlin
Enter your choice: 2
Enter the item to be deleted from the shop: Eraser
Pen: Trimax
Enter your choice : 3
Invalid options. Type 1 to add items and 2 to remove items.

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

12th Computer Science Guide Python Classes and Objects Additional Important Questions and Answers

I. Choose the best answer (1 Mark)

Question 1.
………… is not an object-oriented language.
a) C
b) C++
c) Java
d) Python
Answer:
a) C

Question 2.
All integer variables used in the python program is an object of class ……………………….
Answer:
int

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 3.
………….. are called as Functions of the class.
a) Methods
b) Members
c) Variables
d) Loop
Answer:
a) Methods

Question 4.
In Python, every class name followed by ……………..delimiter.
a) ;
b) :
c) .
d) .
Answer:
b) :

Question 5.
A statement in a class definition may be a ………………………..
(a) variable declaration
(b) decision control
(c) loop
(d) all of these
Answer:
(d) all of these

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 6.
……………… is a valid syntax for crating objects.
a) objectname = classname ()
b) objectname: classname ()
c) objectname = classname
d) classname = Objectname ()
Answer:
a) objectname = classname ()

Question 7.
…………….. is a valid syntax of accessing class members
a) objectname = classmember ()
b) objectname. classmember ()
c) objectname. Classmember
d) objectname.classmember
Answer:
b) objectname. classmember ()

Question 8.
………….. position of the argument named self in python class method.
a) First
b) Second
c) Third
d) Last
Answer:
a) First

Question 9.
The init function should begin and end with
(a) underscore
(b) double underscore
(c) #
(d) S
Answer:
(b) double underscore

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 10.
……………. number of arguments can be taken by Python method even when a method is defined with one argument?
a) 1
b) 3
c) 2
d) 4
Answer:
c) 2

Question 11.
In Python. ……………… function will act as a constructor.
a) int
b) inti
c) class name
d) init
Answer:
d) init

Question 12.
…………………….. is a special function to gets executed automatically when an object exit from the scope.
(a) constructor
(b) init
(c) destructor
(d) object
Answer:
(c) destructor

Question 13.
…………… is used to initialize the class variables.
a) Destructor
b) Object
c) Constructor
d) Class member
Answer:
c) Constructor

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 14.
The ……………..of the class should be accessed through the instance of a class.
a) Objects
b) Members
c) Functions
d) Tuples
Answer:
b) Members

Question 15.
Which variables can be accessed only within the class?
(a) private
(b) public
(c) protected
(d) local
Answer:
(a) private

Question 16.
In Python, the class method must name the first argument named as………….
a) this
b) new
c) self
d) var
Answer:
c) self

Question 17.
…………… and…………… are the key features of object-oriented programming.
a) List and tuples
b) Set and dictionary
c) Classes and objects
d) Variables and methods
Answer:
c) Classes and objects

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 18.
By default, the class variables are ……………..
a) Private
b) Public
c) Protected
d) Method
Answer:
b) Public

II. Answer the following questions (2 and 3 Marks)

Question 1.
Write a note on public and private data members of the python class.
Answer:

  • The variables which are defined inside the class is public by default.
  • These variables can be accessed anywhere in the program using dot operator.
  • A variable prefixed with double underscore becomes private in nature.
  • These variables can be accessed only within the class.

class Sample:
def _init_ (self, n1, n2):
self.n1 =n1
self. _n2=n2
def display (self):
print(“Class variable 1 = “, self.n1)
print(“Class variable 2 = “, self._n2)
S=Sample(12,14)
S.display()
print(“Value 1 = “, S.n1)
print(“Value 2 = “, S._n2)

  • In the above program, there are two class variables n1 and n2 are declared.
  • The variable n1 is a public variable and n2 is a private variable.
  • The display( ) member method is defined to show the values passed to these two variables.
  • The print statements defined within the class will successfully display the values of n1 and n2, even though the class variable n2 is private.
  • Because, in this case, n2 is called by a method defined inside the class.
  • But, when we try to access the value of n2 from outside the class Python throws an error.
  • Because private variables cannot be accessed from outside the class.

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 1.
Write a note on self?
Answer:
The class method must have the first argument named as self. No need to pass a value for this argument when we call the method. Python provides its value automatically. Even if – a method takes no arguments, it should be defined with the first argument called self. If a method is defined to accept only one argument it will take it as two arguments i.e. self and the defined argument.

Question 3.
How Python class function differs from ordinary function.
Answer:

  • Python class function or Method is very similar to ordinary function with, a small difference that, the class method must have the first argument named as self.
  • No need to pass a value for this argument when we call the method. Python provides its value automatically.
  • Even if a method takes no arguments, it should be defined with the first argument called self.
  • If a method is defined to accept only one argument it will take it as two arguments ie. self and the defined argument.

Question 4.
Write the output of the following (March 2020)
Answer:
class Hosting:
def _init_ (self.name)
self. _name=name
def display (self):
print(“Welcome to”,self._name)
obj=Hosting(” Python Programming”)
obj.display()
Output:
Welcome to Python Programming

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 5.
Write a program to calculate area and circumference of a circle?
Answer:
class Circle:
pi=3.14
def_init_(self,radius):
self.radius=radius
def area(self):
return Circle.pi*(self.radius**2)
def circumference(self):
return 2*Circle.pi*self.radius
r = int(input(“Enter Radius:”))
C=Circle(r)
print(“The Area =”,C.area( ))
print(“The Circumference =”, C.circumference( ))
Output:
Enter Radius: 5
The Area = 78.5
The Circumference = 31.400000000000002

HANDS ON PRACTICE

Question 1.
Rewrite the following Python program to get the given output:
OUTPUT:
Enter Radius: 5
The area = 78.5
The circumference = 34.10
CODE:
Class circle ()
pi=3.14
def _init_(self, radius):
self=radius
DEF area(SELF):
Return
Circle.pi + (self.radius * 2)
Def circumference(self):
Return 2*circle.pi * self.radius
r = input(“Enter radius=”)
c = circle(r)
print “The Area:”, c.area()
printf (“The circumference=”, c)

Correct Program:
class Circle:
pi=3.14
def init (self,radius):
self.radius=radius
def area (self):
return Circle.pi*(self.radius**2)
def circumference (self):
return 2*Circle.pi*self.radius
r=int(input(“Enter Radius: “))
C=Circle(r)
print(“The Area =”,C.area())
print(“The Circumference =”, C.circumference())

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 2.
Write a menu driven program to read, display, add and subtract two distances.
Coding:
class Distances:
def init (self):
self.distl =”
self.dist2 = ”
self .result = ”
def inputdata(self):
self.dist1=float(input(/Enter the first point=’))
self.dist2=float(input(“Enter the second point= “))
def adddist(self):
self ,result=self. dist1+self. dist2
def subdist(self):
if self.distl >self.dist2:
self.result=self.distl-self.dist2
else:
self.result=self.dist2-self.distl
def DisplayDist(self):
return self, result
Dt=Distances() .
ch=,y’
while(ch==’y,):
print(“\nl. Add two points\n2.Subtract two points “)
choice=int(input(“\nEnter your choice:”))
if(choice==l):
Dt.inputdataQ
Dt.adddist()
print(“Sum of two points is:”,round
(Dt.DisplayDist(),3))
elif(choice==2):
Dt.inputdata()
Dt.subdist()
print(“Difference in between two points is:”,round(Dt.DisplayDist(),3))
else:
print(“Invalid input”)
ch=input(“do you want to continue y/n: “)
Output:
>>>

RESTART:
C:/Users / COMPUTER/ AppData/ Local / Programs / Python / Py thon37-32/ menudist-05.02.2020. py
1. Add two points
2. Subtract two points Enter your choice: 1
Enter the first point = 58.6
Enter the second point = 12.8
The Sum of two points is: 71.4
1. Add two points
2. Subtract two points
Enter your choice: 2 ,
Enter the first point= 47.5
Enter the second point= 23.6
The difference between the two points is: 23.9
1. Add two points
2.Subtract two points
Enter your choice: 4
Invalid input
do you want to continue y/n: n
>>>

Samacheer Kalvi 12th Computer Science Guide Chapter 10 Python Classes and Objects

Question 3.
What will be the output of the following Python code
class String:
def _init_(self):
self.uppercase=0
self.lowercase=0
self.vowels=0
self.consonants=0
self.spaces=0
self.string=””
def getstr (self):
self. string=” Welcome Puducherry”
def count_upper(self):
for ch in self.string:
if (ch.isupper())
self.uppercase+=1
def count_lo wer (self):
for ch in self.string:
if (ch.islower())
self.lowercase+=1
def count_vowers(self)
for ch in self.string:
if (ch in (‘A’, ‘a’, V, ‘E!, T, T, ‘o’, ‘O’, ‘u’,’U’)):
self.vowers+=1
def count_consonants(self):
for ch in self.string:
if (ch not in ((‘A’, ‘a’, V, ‘E’, Y, T, ‘o’, ‘O’, ‘u’, ‘U’,”)):
self.consonants+=1
def count_space (self):
for ch in self.string:
if (ch==” “):
self spaces+=1
def execute (self):
self.count_upper()
self.count_lower() ¦
self.count_vowels()
self.count_consonants()
self.count_space()
def display (self):
print (” The given string contains…”)
print(“%d Uppercase letters”% self .uppercase)
pring(“&d Lowercase letters” % self .lowrcase)
print(” % d V owels” % self .vowels)
print(” % d Consonants” % self, consonants)
pring(“%d Spaces” % self.spaces)
S = String()
S.getstr()
S.execute()
S.display()
Output:
The given string contains…
2 Uppercase letters
17 Lowercase letters
7 Vowels
12 Consonants
2 Spaces

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Computer Science Guide Pdf Chapter 11 Database Concepts Text Book Back Questions and Answers, Notes.

Tamilnadu Samacheer Kalvi 12th Computer Science Solutions Chapter 11 Database Concepts

12th Computer Science Guide Database Concepts Text Book Questions and Answers

I. Choose the best answer (1 Marks)

Question 1.
What is the acronym of DBMS?
a) Data Base Management Symbol
b) Database Managing System
c) Data Base Management System
d) DataBasic Management System
Answer:
c) Data Base Management System

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 2.
A table is known as
a) tuple
b) attribute
c) relation
d) entity
Answer:
c) relation

Question 3.
Which database model represents parent-child relationship?
a) Relational
b) Network
c) Hierarchical
d) Object
Answer:
c) Hierarchical

Question 4.
Relational database model was first proposed by
a) E F Codd
b) E E Codd
c) E F Cadd
d) E F Codder
Answer:
a) E F Codd

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 5.
What type of relationship does hierarchical model represents?
a) one-to-one
b) one-to-many
c) many-to-one
d) many-to-many
Answer:
b) one-to-many

Question 6.
Who is called Father of Relational Database from the following?
a) Chris Date
b) Hugh Darween
c) Edgar Frank Codd
d) Edgar Frank Cadd
Answer:
c) Edgar Frank Codd

Question 7.
Which of the following is an RDBMS?
a) Dbase
b) Foxpro
c) Microsoft Access
d) SQLite
Answer:
d) SQLite

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 8.
What symbol is used for SELECT statement?
a) o
b) n
c) X
d) Q
Answer:
a) o

Question 9.
A tuple is also known as
a) table
b) row
c) attribute
d) field
Answer:
b) row

Question 10.
Who developed ER model?
a) Chen
b) EF Codd
c) Chend
d) Chand
Answer:
a) Chen

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

II. Answer the following questions (2 Marks)

Question 1.
Mention few examples of a database.
Answer:
dbase-III , dbase-III Plus, Foxbase , Foxpro ,SQL Server, Oracle Database, Sybase, Informix, MySQL are some examples of Database languages which are used to design ERP applications like Payroll, Railway Reservation System, Inventory Systems.

Question 2.
List some examples of RDBMS.
Answer:
SQL Server, Oracle Database, Sybase, Informix, MySQL.

Question 3.
What is data consistency?
Answer:
Data Consistency
On live data, it is being continuously updated and added, maintaining the consistency of data can become a challenge. But DBMS handles it by itself. Data Consistency means that data values are the same at all instances of a database.

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 4.
What is the difference between the Hierarchical and Network data model?
Answer:

Hierarchical Data Model Network Data Model
1 A child record has only one parent node A child may have many parent nodes
2 It represents the data in one-to-many relationships It represents the data in many-to-many relationships
3 This model is not easier and faster to access the data than the Network data model. This model is easier and faster to access the data.

Question 5.
What is normalization?
Answer:

  • Normalization is a process of organizing the data in the database to avoid data redundancy and to improve data integrity.
  • Database normalization was first proposed by Dr. Edgar F Codd as an integral part of RDBMS. These rules are known as the E F Codd Rules.

III. Answer the following questions (3 Marks)

Question 1.
What is the difference between Select and Project
Answer:

Select Project
The SELECT operation(o) is used for selecting a subset with tuples according to a given selection condition. The projection method(n) eliminates all attributes of the input relation but those mentioned in the projection list.
The SELECT operation (o) selects filters out all tuples that do not satisfy the condition. The projection method defines a relation that contains a vertical subset of Relation.
Symbol: σ Symbol: π
General Form:
σ (R)
c
Example:
σ = “Big Data” (STUDENT) course
Example:
π  (STUDENT)
course

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 2.
What is the role of DBA?
Answer:

  1. Database Administrator or DBA is the one who manages the complete database management system.
  2. DBA takes care of the security of the DBMS, managing the license keys, managing user accounts and access etc.

Question 3.
Explain Cartesian Product with a suitable example.
Answer:

  • Cross product is a way of combining two relations.
  • The resulting relation contains, both relations being combined.
  • A x B means A times B, where the relation A and B have different attributes.
  • This type of operation is helpful to merge columns from two relations
studno name studno subject
cs1 Kannan cs28 Big Data
cs2 Gowri Shankar cs62 R language
cs4 Padmaja cs25 Python Programming

Cartesian product; Table A x Table B

studno name course subject
cs1 Kannan cs28 Big Data
cs1 Kannan cs62 . R language
cs1 Kannan cs25 Python Programming
cs2 Gowri Shankar cs28 Big Data
cs2 Gowri Shankar cs’62 R language
cs2 Gowri Shankar cs25 Python Programming
cs4 Padmaja cs28 Big Data
cs4 Padmaja cs62 R language
cs4 Padmaja cs25 Python Programming

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 4.
Explain the Object Model with an example.
Answer:
Object Model:

  • Object model stores the data in the form of objects, attributes and methods, classes and inheritance.
  • This model handles more complex applications, such as Geographic Information System (GIS), scientific experiments, engineering design and manufacturing.
  • It is used in file Management System.
  • It represents real-world objects, attributes and behaviours.
  • It provides a clear modular structure.
  • It is easy to maintain and modify the existing code.

An example of the Object model is : Shape
Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts 1
Circle, Rectangle, and Triangle are all objects in this model

  • The circle has the attribute radius.
  • Rectangle has the length and breadth of the attribute.
  • Triangle has the attributes base and height.
  • The objects Circle, Rectangle, and Triangle inherit from the object Shape.

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 5.
Write a note on different types of DBMS users.
Answer:
Types of DBMS Users
(i) Database Administrator:
Database Administrator or DBA is the one who manages the complete database management system. DBA takes care of the security of the DBMS, managing the license keys, managing user accounts and access etc.

(ii) Application Programmers or Software Developers:
This user group is involved in developing and designing the parts of DBMS.

(iii) End User:
End users are the ones who stores, retrieve, update and delete data.

(iv) Database designers: are responsible for identifying the data to be stored in the database for choosing appropriate structures to represent and store the data.

IV. Answer the following questions (5 Marks)

Question 1.
Explain the different types of data models.
Answer:
The different types of a Data Model are:

  1. Hierarchical Model,
  2. Relational Model,
  3. Network Database Model,
  4. Entity-Relationship Model,
  5. Object Model.

Hierarchical Model:

  • The hierarchical model was developed by IBM as Information Management System.
  • In the Hierarchical model, data is represented as a simple tree-like structure form.
  • This model represents a one-to-many relationship i.e., parent-child relationship.
  • One child can have only one parent but one parent can have many children.
  • This model is mainly used in IBM Main Frame computers.

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts 2

Relational Model:

  • The Relational Database model was first proposed by E.F. Codd in 1970.
  • Nowadays, it is the most widespread data model used for database applications around the world.
  • The basic structure of data in the relational model is tabling (relations).
  • All the information related to a particular type is stored in rows of that table.
  • Hence tables are also known as relations in a relational model.
  • A relation key is an attribute that uniquely identifies a particular tuple (row in a relation (table)).

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts 3

Network Model:
A network database model is an extended form of the hierarchical data model.
The difference between hierarchical and Network data model is:

  • In a hierarchical model, a child record has only one parent node,
  • In a Network model, a child may have many parent nodes.
  • It represents the data in many-to-many relationships.
  • This model is easier and faster to access the data.

Example:

  • School represents the parent node
  • Library, Office, and Staffroom is a child to school (parent node)
  • Student is a child in the library, office and staff room (one to many relationships)

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts 4

Entity-Relationship Model. (ER model):

  • In this database model, relationships are created by dividing the object into the entity and its characteristics into attributes.
  • It was developed by Chen in 1976.
  • This model is useful in developing a conceptual design for the database.
  • It is very simple and easy to design a logical view of data.
  • The developer can easily understand the system by looking at ER model constructed.
  • The rectangle represents the entities.

Example. Doctor and Patient.

  • Ellipse represents the attributes
    E.g. D-id, D-name, P-id, P-name.
  • Attributes describe the characteristics and each entity becomes a major part of the data stored in the database.
  • The diamond represents the relationship in ER diagrams e.g; Doctor diagnosis the Patient

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts 5

Object Model:

  • Object model stores the data in the form of objects, attributes, and methods, classes, and Inheritance.
  • This model handles more complex applications, such as Geographic Information System (GIS), scientific experiments, engineering design, and manufacturing.
  • It is used in the file Management System.
  • It represents real-world objects, attributes, and behaviours.
  • It provides a clear modular structure. It is easy to maintain and modify the existing code.

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts 6

Example of the Object model is Shape,
Circle, Rectangle and Triangle are all objects in this model

  • The circle has the attribute radius.
  • Rectangle has the length and breadth of the attribute.
  • Triangle has the attributes base and height.
  • The objects Circle, Rectangle, and Triangle inherit from the object Shape.

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 2.
Explain the different types of relationship mapping.
Answer:
The types of relationships used in a database are

  • One-to-One Relationship
  • One-to-Many Relationship
  • Many-to-One Relationship
  • Many-to-Many Relationship

One-to-One Relationship:

  • In One-to-One Relationship, one entity is related with only one other entity.
  • One row in a table is linked with only one row in another table and vice versa. Example: A student can have only one exam number.

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts 7

One-to-Many Relationship:

  • In a One-to-Many relationship, one entity is related to many other entities.
  • One row in table A is linked to many rows in table B, but one row in table B is linked to only one row in table A. Example: One Department has many staff members.

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts 8

Many to-one Relationship

  • In Many-to-One Relationship, many entities can be related with only one in the other entity.
  • Example: A number of staff members working in one Department. Multiple rows in staff members table is related with only one row in Department table.

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts 9

Many-to-Many Relationship:

  • A many-to-many relationships occurs when multiple records in a table are associated with multiple records in another table.
  • Example 1: Customers and Product

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts 10

Customers can purchase various products and Products can be purchased by many customers.

Example 2: Students and Courses
A student can register for many Courses and a Course may include many students

Example 3: Books and Student.
Many Books in a Library are issued to many students.

Question 3.
Differentiate DBMS and RDBMS.
Answer:

Basis of Comparison DBMS RDBMS
Expansion Database Management System Relational Database Management System
Data storage Navigational model ie data by linked records Relational model (in tables), ie data in tables as row and column
Data redundancy Exhibit Not Present
Normalization Not performed RDBMS uses normalization to reduce redundancy
Data access Consumes more time Faster, compared to DBMS.
Keys and indexes Does not use. used to establish a relationship. Keys are used in RDBMS.
Transaction

management

Inefficient, Error-prone, and insecure Efficient and secure.
Distributed Databases Not supported Supported by RDBMS.
Example Dbase, FoxPro. SQL Server, Oracle, MySQL, MariaDB, SQLite.

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 4.
Explain the different operators in Relational algebra with suitable examples.
Answer:
Relational Algebra is divided into various groups:
Unary Relational Operations:

  1. SELECT (symbol: σ)
  2. PROJECT (symbol: π)

Relational Algebra Operations from Set Theory:

  1. UNION (U)
  2. INTERSECTION (∩)
  3. DIFFERENCE (-)
  4. CARTESIAN PRODUCT (X)

SELECT symbol: σc (R) with a relation R and a condition C on the attributes of R

  • The SELECT operation is used for selecting a subset with tuples according to a given condition.
  • Select filters out all tuples that do not satisfy C

Table A : STUDENT :

Studno Name Course Year
cs1 Kannan Big Data II
cs2 Gowri
Shankar
R Language I
cs3 Lenin Big Data I
cs4 Padmaja Python
Programming
I

σcourse = <Big Data> (Student)

Studno Name Course Year
csl Kannan Big Data II
cs2 Lenin Big Data I

PROJECT (symbol: n):

  • The projection eliminates all attributes of the input relation but those mentioned in the projection list.
  • The projection method defines a relation that contains a vertical subset of Relation.
  • Example 1 using Table A
    πcourse (STUDENT)

Result:

Course :
Big Data
R language
Python Programming

Example 2 (using Table A)
πstudent, course (STUDENT)

Studno Course
cs1 Big Data
cs2 R language
cs3 Big Data
cs4 Python Programming

UNION (Symbol: U):

  • It includes all tuples that are in tables A or in B.
  • It also eliminates duplicates.
  • Set A Union Set B would be expressed as A U B

Example 3
Consider the following tables

Table A

Studno Name
cs1 Kannan
cs2 Lenin
cs3 Padmaja

Table B

Studno Name
cs1 Kannan
cs2 Lenin
cs3 Padmaja

Result (A U B)

Table A

Studno Name
cs1 Kannan
cs2 Gowrishankaran
cs3 Lenin
cs4 Padmaja

SET DIFFERENCE ( Symbol: -):

  • The result of A – B, is a relation which includes all tuples that are in A but not in B.
  • The attribute name of A has to match with the attribute name in B.
  • Example 4 (using Table B):

Result:

Table
Cs4 Padmaja

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

INTERSECTION (symbol: ∩) A ∩ B:

  • INTERSECTION Defines a relation consisting of a set of all tuple that are in both in A and B.
  • However, A and B must be union-compatible.

Example 5 (using Table B)

Table A – B
cs1 Kannan
cs3 Lenin

PRODUCT OR CARTESIAN PRODUCT (Symbol: X)

  • Cross product is a way of combining two relations. The resulting relation contains, both relations being combined.
  • A x B means A times B, where the relation A and B have different attributes.
  • This type of operation is helpful to merge columns from two relations.
Table A ‘                   Table B
studno name studno

subject

cs1 Kannan cs28 Big Data
cs2 Gowri Shankar cs62 R language
cs4 Padmaja cs25 Python Programming
studno name course subject
csl Kannan cs28 Big Data
csl Kannan cs62 R language
csl Kannan cs25 Python Programming
cs2 Gowri Shankar cs28 Big Data
cs2 Gowri Shankar cs62 R language
cs2 Gowri Shankar cs25 Python Programming
cs4 Padmaja cs28 Big Data
cs4 Padmaja cs62 R language
cs4 Padmaja cs25 Python Programming

Question 5.
Explain the characteristics of DBMS.
Answer:
Characteristics of Database Management system:

Data stored in Table Data is never directly stored in the database. Data is stored in tables, created inside the database. DBMS also allows having relationships between tables which makes the data more meaningful and connected.
Reduced Redundancy In the modern world, hard drives are very cheap, but earlier when hard drives were too expensive, unnecessary repetition of data in databases was a big problem But DBMS follows Normalization which divides the data in such a way that repetition is minimum.
Data Consistency On live data, it is being continuously updated and added, maintaining the consistency of data can become a challenge. But DBMS handles it by itself.
Support Multiple user and Concurrent Access DBMS allows multiple users to work on it( update, insert, delete data) at the same time and still manages to maintain data consistency.
Query Language DBMS provides users with a simple query language, using which data can be easily fetched, inserted, deleted, and updated in a database.
Security The DBMS also takes care of the security of data, protecting the data from unauthorized access. In a typical DBMS, we can create user accounts with different access permissions, using which we can easily secure our data by restricting user access.
DBMS Supports Transac­tions It allows us to better handle and manage data integrity in real-world applications where multi-threading is extensively used.

12th Computer Science Guide Database Concepts Additional Important Questions and Answers

I. Choose the best answer (1 Mark)

Question 1.
…………………… are raw facts stored in a computer
(a) data
(b) Information
(c) row
(d) tuple
Answer:
(a) data

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 2.
………………….is an organized collection of data, which can be stored and accessed electronically from a computer system
a) Worksheet
b) Database
c) DBMS
d) Information
Answer:
b) Database

Question 3.
……………………. is a repository collection of related data
(a) data
(b) Information
(c) database
(d) tuple
Answer:
(c) database

Question 4.
In………………….data are organized in a way that, they can be easily accessed, managed, and updated.
a) Database
b) Pointer
c) Structure
d) Object
Answer:
a) Database

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 5.
………………….allows users to store, process, and analyze data easily.
a) My SQL
c) My SQL SQLite
b) Relational Algebra
d) DBMS
Answer:
d) DBMS

Question 6.
Find the wrong statement about DBMS?
(a) segregation of application program
(b) Maximum data Redundancy
(c) Easy retrieval of data
(d) Reduced development time
Answer:
(b) Maximum data Redundancy

Question 7.
…………………. provides protection and security to the databases
a) MySQL
b) DBMS
c) Oracle
d) Ingress
Answer:
b) DBMS

Question 8.
…………………. can be software or hardware-based, with one sole purpose of storing data.
a) MySQL
b) DBMS
c) Database
d) Ingress
Answer:
c) Database

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 9.
Which is the language used to write commands to access, insert, update data stored in the database?
(a) DataBase Access Languages
(b) Javascript
(c) Basic
(d) Foxpro
Answer:
(a) DataBase Access Languages

Question 10.
…………………. major components are there in DBMS?
a) Four
b) Three
c) Five
d) Two
Answer:
c) Five

Question 11.
…………………. characteristics of DBMS allows to better handle and manage data integrity
a) Data redundancy
b) Data security
c) DBMS Supports Transactions
d) Data integrity
Answer:
c) DBMS Supports Transactions

Question 12.
…………………. DBMS components that manage databases to take backups, report generation.
a) Software
b) Hardware
c) Data
d) Procedures/Methods
Answer:
d) Procedures/Methods

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 13.
…………………. in a table represents a record.
a) Row
b) Column
c) File
d) Data
Answer:
a) Row

Question 14.
Which of the following is not a DBMS component?
a) Hardware/ Software
b) Data
c) Procedures
d) Data model
Answer:
d) Data model

Question 15.
Hierarchical Model was developed by ……………………….
(a) Apple
(b) IBM
(c) Microsoft
(d) Macromedia
Answer:
(b) IBM

Question 16.
…………………. is not a type of data model?
a) Hierarchical model
b) Entity-Relationship model
c) Object model
d) Redundancy model
Answer:
d) Redundancy model

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 17.
…………………. is an extended form of hierarchical data model.
a) ER model
b) Hierarchical mode
c) Network database model
d) Object model
Answer:
c) Network database model

Question 18.
The relational model was developed in the year ……………………..
(a) 1980
(b) 1970
(c) 1965
(d) 1985
Answer:
(b) 1970

Question 19.
The abbreviation of GIS is
a) Global Information System
b) Geographic Information System
c) Global Information Source
d) Geographic Intelligent System
Answer:
b) Geographic Information System

Question 20.
Data is represented as a simple tree-like structure form in the data model
a) Network database
b) Hierarchical model
c) ER model
d) Relational model
Answer:
b) Hierarchical model

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 21.
ER Model Expand ………………………..
(a) Entry Relation
(b) Entity Relationship
(c) Entire Row
(d) Entity Row
Answer:
(b) Entity Relationship

Question 22.
…………………. takes care of the security of the DBMS, managing the license keys, managing user accounts and access.
a) Database Designer
b) Database Administrator
c) Database Architect
d) Data Analyst
Answer:
b) Database Administrator

Question 23.
The …………………. operation is used for selecting a subset with tuples according
to a given condition.
a) CARTESIAN PRODUCT
b) SELECT
c) Union
d) Intersection
Answer:
b) SELECT

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 24.
Find the wrongly matched pair.
(a) Entities – Rectangle
(b) Ellipse – attributes
(c) Diamond – relationship
(d) row – square
Answer:
(d) row – square

II. Answer the following questions (2 and 3 Marks)

Question 1.
What is a database?
Answer:

  • The database is a repository collection of related data organized in a way that data can be easily accessed, managed, and updated.
  • The database can be software or hardware-based, with one sole purpose of storing data.

Question 2.
Write the advantages of DBMS.
Answer:

  • Segrega n f application program
  • Minimal date duplication or Data Redundancy
  • Easy retrieval of data using the Query Language
  • Reduced development time and maintenance

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 3.
Define Data and Information.
Answer:

Data Information
Data are raw facts stored in a computer Information is formatted data
Data may contain any character, text, word, or number. The information allows being utilized in a significant way

Question 4.
Define Table?
Answer:
Table is the entire collection of related data in one table, referred to as a File or Table where the data is organized as row and column.

Question 5.
Define: Database structure
Answer:

  • Table is the entire collection of related data in one table, referred to as a File or Table where the data is organized as row and column.
  • Each row in a table represents a record, which is a set of data for each database entry.
  • Each table column represents a Field, which groups each piece or item of data among the records into specific categories or types of data.

Example: StuNo., StuName, StuAge, StuClass, StuSec.,

  • A Table is known as a RELATION S
  • A Row is known as a TUPLE S
  • A column is known as an ATTRIBUTE

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 6.
Write a note on relational Algebra?
Answer:
Relational Algebra is a procedural query language used to query the database tables using SQL. Relational algebra operations are performed recursively on a relation (table) to yield output.

Question 7.
What is Data model?
Answer:

  • A data model describes how the data can be represented and accessed from the software after complete implementation.
  • It is a simple abstraction of a complex real-world data gathering environment.
  • The main purpose of the data model is to give an idea of how the final system or software will look after development is completed.

Question 8.
What is Relational Algebra?
Answer:

  • Relational Algebra, was first created by Edgar F Codd while at IBM.
  • It was used for modeling the data stored in relational databases and defining queries on it.
  • Relational Algebra is a procedural query language used to query the database tables using SQL.
  • Relational algebra operations are performed recursively on a relation (table) to yield an output.
  • The output of these operations is a new relation, which might be formed by one or more input relations.

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

Question 9.
List the types of data model.
Answer:

  • Hierarchical Model
  • Relational Model
  • Network Database Model
  • Entity-Relationship Model
  • Object Model

Question 10.
List the types of DBMS users.
Answer:

  • Database Administrators (DBA)
  • Application or software developers
  • End-User
  • Database designers

Question 11.
Write short notes on Relational Data Model.
Answer:

  • The Relational Database model was first proposed by E.F. Codd in 1970 . Nowadays, it is the most widespread data model used for database applications around the world.
  • The basic structure of data in the relational model is tables (relations). All the information related to a particular type is stored in rows of that table. Hence tables are also known as relations in a relational model. A relation key is an attribute which uniquely identifies a particular tuple.

Samacheer Kalvi 12th Computer Science Guide Chapter 11 Database Concepts

III. Answer the following questions (5 Marks)

Question 1.
Explain the components of DBMS
Answer:
The Database Management System can be divided into five major components namely 1. Hardware, 2. Software, 3. Data, 4. Procedures/Methods
5. Database Access Languages

1. Hardware:
The computer, hard disk, I/O channels for data, and any other physical component involved in the storage of data

2. Software:
This main component is a program that controls everything.
The DBMS software is capable of understanding the Database Access Languages and interprets them into database commands for execution.

3. Data:
It is that resource for which DBMS is designed. DBMS creation is to store and utilize data.

4. Procedures/ Methods:
They are general instructions to use a database management system such as the installation of DBMS, manage databases to take backups, report generation, etc

5. DataBase Access Languages :

  • They are the languages used to write commands to access, insert, update and delete data stored in any database.
  • Examples of popular DBMS: Dbase, FoxPro

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Computer Science Guide Pdf Chapter 5 Python -Variables and Operators Text Book Back Questions and Answers, Notes.

Tamilnadu Samacheer Kalvi 12th Computer Science Solutions Chapter 5 Python -Variables and Operators

12th Computer Science Guide Python -Variables and Operators Text Book Questions and Answers

I. Choose the best answer (1 Marks)

Question 1.
Who developed Python ?
a) Ritche
b) Guido Van Rossum
c) Bill Gates
d) Sunder Pitchai
Answer:
b) Guido Van Rossum

Question 2.
The Python prompt indicates that Interpreter is ready to accept instruction.
a) > > >
b) < < <
c) #
d) < <
Answer:
a) > > >

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 3.
Which of the following shortcut is used to create a new Python Program?
a) Ctrl + C
b) Ctrl + F
c) Ctrl + B
d) Ctrl + N
Answer:
d) Ctrl + N

Question 4.
Which of the following character is used to give comments in Python Program?
a) #
b) &
c) @
d) $
Answer:
a) #

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 5.
This symbol is used to print more than one item on a single line.
a) Semicolon(;)
b) Dollor($)
c) commaQ
d) Colon(:)
Answer:
c) commaQ

Question 6.
Which of the following is not a token?
a) Interpreter
b) Identifiers
c) Keyword
d) Operators
Answer:
a) Interpreter

Question 7.
Which of the following is not a Keyword in Python?
a) break
b) while
c) continue
d) operators
Answer:
d) operators

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 8.
Which operator is also called a Comparative operator?
a) Arithmetic
b). Relational
c) Logical
d) Assignment
Answer:
b) Relational

Question 9.
Which of the following is not a Logical operator?
a) and
b) or
c) not
d) Assignment
Answer:
d) Assignment

Question 10.
Which operator is also called a Conditional operator?
a) Ternary
b) Relational
c) Logical
d) Assignment
Answer:
a) Ternary

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

II. Answer the following questions (2 Marks)

Question 1.
What are the different modes that can be used to test Python Program?
Answer:
In Python, programs can be written in two ways namely Interactive mode and Script mode. The Interactive mode allows us to write codes in Python command prompt (>>>) whereas in script mode programs can be written and stored as separate file with the extension .py and executed. Script mode is used to create and edit python source file.

Question 2.
Write short notes on Tokens.
Answer:
Python breaks each logical line into a sequence of elementary lexical components known as Tokens.
The normal token types are

  1. Identifiers
  2. Keywords
  3. Operators
  4. Delimiters
  5. Literals

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 3.
What are the different operators that can be used in Python?
Answer:
In computer programming languages operators are special symbols which represent computations, conditional matching etc. The value of an operator used is called operands. Operators are categorized as Arithmetic, Relational, Logical, Assignment etc.

Question 4.
What is a literal? Explain the types of literals?
Answer:

  • Literal is raw data given in a variable or constant.
  • In Python, there are various types of literals.
  1. Numeric
  2. String
  3. Boolean

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 5.
Write short notes on Exponent data.
Answer:
An Exponent data contains decimal digit part, decimal point, exponent part followed by one or more digits.
12.E04, 24.e04 # Exponent data

III. Answer the following questions (3 Marks)

Question 1.
Write short notes on the Arithmetic operator with examples.
Answer:

  • An arithmetic operator is a mathematical operator that takes two operands and performs a calculation on them.
  • They are used for simple arithmetic.
  • Most computer languages contain a set of such operators that can be used within equations to perform different types of sequential calculations.
  • Python supports the following Arithmetic operators.
Operator-Operation Examples Result
Assume a=100 and b=10 Evaluate the following expressions
+ (Addition) > > > a+b 110
– (Subtraction) > > > a-b 90
* (Multiplication) > > > a*b 1000
/ (Division) > > > a/b 10.0
% (Modulus) > > > a% 30 10
** (Exponent) > > > a**2 10000
/ / (Floor Division) > > > a// 30 (Integer Division) 3

Question 2.
What are the assignment operators that can be used in Python?
Answer:

  • In Python,= is a simple assignment operator to assign values to variables.
  • There are various compound operators in Python like +=, -=, *=, /=,%=, **= and / / = are also available.
  • Let = 5 and = 10 assigns the values 5 to and 10 these two assignment statements can also be given a =5 that assigns the values 5 and 10 on the right to the variables a and b respectively.
Operator Description Example
Assume x=10
= Assigns right side operands to left variable »> x=10

»> b=”Computer”

+= Added and assign back the result to left operand i.e. x=30 »> x+=20 # x=x+20
= Subtracted and assign back the result to left operand i.e. x=25 >>> x-=5 # x=x-5

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 3.
Explain the Ternary operator with examples.
Answer:
Conditional operator:
Ternary operator is also known as a conditional operator that evaluates something based on a condition being true or false. It simply allows testing a condition in a single line replacing the multiline if-else making the code compact.
The Syntax conditional operator is,
Variable Name = [on – true] if [Test expression] else [on – false]
Example:
min = 50 if 49 < 50 else 70 # min = 50 min = 50 if 49 > 50 else 70 # min = 70

Question 4.
Write short notes on Escape sequences with examples.
Answer:

  • In Python strings, the backslash “\” is a special character, also called the “escape” character.
  • It is used in representing certain whitespace characters: “t” is a tab, “\n\” is a new line, and “\r” is a carriage return.
  • For example to print the message “It’s raining”, the Python command is > > > print (“It \ ‘s raining”)
  • output:
    It’s raining
Escape sequence character Description Example Output
w Backslash >>> print(“\\test”) \test
Y Single-quote »> print(“Doesn\’t”) Doesn’t
\” Double-quote »> print(“\”Python\””) “Python”
\n New line pr in t (” Python “,” \ n”,” Lang..”) Python Lang..
\t Tab print(“Python”,”\t”,”Lang..”) Python Lang..

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 5.
What are string literals? Explain.
Answer:
String Literals:
In Python, a string literal is a sequence of characters surrounded by quotes. Python supports single, double and triple quotes for a string. A character literal is a single character surrounded by single or double-quotes. The value with triple – the quote is used to give multi-line string literal.
Strings = “This is Python”
char = “C”
multiline _ str = “This is a multiline string with more than one line code”.

IV. Answer the following questions (5 Marks)

Question 1.
Describe in detail the procedure Script mode programming
Answer:

  • Basically, a script is a text file containing the Python statements.
  • Python Scripts are reusable code.
  • Once the script is created, it can be executed again and again without retyping.
  • The Scripts are editable

Creating Scripts in Python:

  • Choose File → New File or press Ctrl + N in the Python shell window.
  • An untitled blank script text editor will be displayed on the screen.
  • Type the code in Script editor
    a=100
    b=350
    c=a+b
    print(“The Sum=”,c)

Saving Python Script:

  • Choose File →Save or press Ctrl+S
  • Now, Save As dialog box appears on the screen
  • In the Save As dialog box, select the location where you want to save your Python code, and type the File name box Python files are by default saved with extension by Thus, while creating Python scripts using Python Script editor, no need to specify the file extension.
  • Finally, ‘click Save button to save your Python script.

Executing Python Script:

  • Choose Run-Run Module or Press F5
  • If code has any error, it will be shown in red color in the IDLE window,, and Python describes the type of error occurred. To correct the errors, go back to Script editor, make corrections, save the file using Ctrl + S or File→Save and execute it again.
  • For all error-free code, the output will appear in the IDLE window of Python.

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 2.
Explain input () and print() functions with examples.
Answer:
input () function:
In Python input() function is used to accept data as input at run time.
Syntax:
Variable = input (“prompt string”)

  • where, prompt string in the syntax is a statement or message to the user, to know what input can be given.
  • The input() takes whatever is typed from the keyboard and stores the entered data in the given variable.
  • If prompt string is not given in input() no message is displayed on the screen, thus, the user will not know what is to be typed as input

Example:
> > > city=input(“Enter Your City: “)
Enter Your City: Madurai
> > > print(“I am from “, city)
I am from Madurai

  • The input () accepts all data as string or characters but not as numbers.
  • If a numerical value is entered, the input values should be explicitly converted into numeric data type.
  • The int( ) function is used to convert string data as integer data explicitly.

Example:
x= int (input(“Enter Number 1: “))
y = int (input(“Enter Number 2: “))
print (“The sum =”, x+y)
Output
Enter Number 1: 34
Enter Number 2: 56
The sum = 90
print () function :
In Python, the print() function is used to display result on the screen. The syntax for print() is as follows:

Syntax:
print (“string to be displayed as output” )
print (variable)
print (“String to be displayed as output variable)
print (“String 1 “, variable, “String 2′”,variable, “String 3” )….)

Example
> > > print (“Welcome to Python Programming”)
Welcome to
Python Programming
> > > x= 5
> > > y= 6
> > > z=x+y
> > > print (z)
11
> > > print (“The sum =”,z)
The sum=11
> > > print (“The sum of”,x, “and “, y, “is “,z)
The sum of 5 and 6 is 11

  • The print( ) evaluates the expressions before printing it on the monitor
  • The print( ) displays an entire statement which specified within print ( )
  • Comma (,) is used as a separator in print more than one time

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 3.
Discuss in detail about Tokens in Python
Answer:
Python breaks each logical line into a sequence of elementary lexical components known as Token.
The normal token types are

  1. Identifiers
  2. Keywords
  3. Operators
  4. Delimiters and
  5. Literals.

Identifiers:

  • An Identifier is a name used to identify a variable, function, class, module or object.
  • An identifier must start with an alphabet
    (A..Z or a..z) or underscore (_). Identifiers may contain digits (0 .. 9). „
  • Python identifiers are case sensitive i.e. uppercase and lowercase letters are distinct. Identifiers must not be a python keyword.
  • Python does not allow punctuation characters such as %,$, @, etc., within identifiers.

Keywords:
Keywords are special words used by Python interpreters to recognize the structure of the program. As these words have specific meanings for interpreters, they cannot be used for any other purpose.

Operators:

  • In computer programming languages operators are special symbols which represent computations, conditional matching, etc.
  • The value of an operator used is called operands.
  • Operators are categorized as Arithmetic, Relational, Logical, Assignment, etc. Value and variables when used with the operator are known as operands

Delimiters:
Python uses the symbols and symbol combinations as delimiters in expressions, lists, dictionaries, and strings
Following are the delimiters knew as operands.
Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators 1
Literals:
Literal is raw data given in a variable or constant. In Python, there are various types of literals.

  • Numeric
  • String
  • Boolean

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

12th Computer Science Guide Python -Variables and Operators Additional Questions and Answers

I. Choose the best answer (1 Mark)

Question 1.
Python language was released in the year
a) 1992
b) 1994
c) 1991
d) 2001
Answer:
c) 1991

Question 2.
CWI means ……………………………
Answer:
Centrum Wiskunde & Information

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 3.
In Python, How many ways programs can be written?
a) 4
b) 2
c) 3 ‘
d) many
Answer:
b) 2

Question 4.
Find the wrong statement from the following.
(a) Python supports procedural approaches
(b) Python supports object-oriented approaches
(c) Python is a DBMS tool
Answer:
(c) Python is a DBMS tool

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 5.
Which mode displays the python code result immediately?
a) Compiler
b) Script
c) Interactive
d) program
Answer:
c) Interactive

Question 6.
Which of the following command is used to execute the Python script?
a) Run → Python Module
b) File → Run Module
c) Run → Module Fun
d) Run → Run Module
Answer:
d) Run → Run Module

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 7.
The extension for the python file is ……………………………
(a) .pyt
(b) .pt
(c) .py
(d) .pyth
Answer:
(c) .py

Question 8.
Which operator replaces multiline if-else in python?
a) Local
b) Conditional
c) Relational
d) Assignment
Answer:
b) Conditional

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 9.
Which of the following is a sequence of characters surrounded by quotes?
a) Complex
b) String literal
c) Boolean
d) Octal
Answer:
b) String literal

Question 10.
What does prompt (>>>) indicator?
(a) Compiler is ready to debug
(b) Results are ready
(c) Waiting for the Input data
(d) Interpreter is ready to accept Instructions
Answer:
(d) Interpreter is ready to accept Instructions

Question 11.
In Python shell window opened by pressing.
a) Alt + N
b) Shift + N
c) Ctrl + N
d) Ctrl + Shift +N
Answer:
c) Ctrl + N

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 12.
In Python, comments begin with …………..
a) /
b) #
c)\
d) //
Answer:
b) #

Question 13.
Which command is selected from the File menu creates a new script text editor?
(a) New
(b) New file
(c) New editor
(d) New Script file
Answer:
(b) New file

Question 14.
Python uses the symbols and symbol combinations as ……………. in expressions
a) literals
b) keywords
c) delimiters
d) identifiers
Answer:
c) delimiters

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 15.
All data values in Python are ……………
a) class
b) objects
c) type
d) function
Answer:
b) objects

Question 16.
…………………………… command is used to execute python script?
(a) Run
(b) Compile
(c) Run ? Run Module
(d) Compile ? Compile Run
Answer:
(c) Run ? Run Module

Question 17.
Octal integer uses …………………………… to denote octal digits
(a) OX
(b) O
(c) OC
(d) Od
Answer:
(b) O

Question 18.
Find the hexadecimal Integer.
(a) 0102
(b) 0876
(c) 0432
(d) 0X102
Answer:
(d) 0X102

Question 19.
How many floating-point values are there is a complex number?
(a) 1
(b) 2
(c) 3
(d) 4
Answer:
(b) 2

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

II. Answer the following questions (2 and 3 Marks)

Question 1.
Write a note on keywords. Give examples?
Answer:
Keywords are special words used by Python interpreters to recognize the structure of the program. As these words have specific meanings for interpreters, they cannot be used for any other purpose. Eg, While, if.

Question 2.
What are keywords? Name any four keywords in Python.
Answer:
Keywords are special words that are used by Python interpreters to recognize the structure of the program.
Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators 2

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 3.
Write a note on the relational or comparative operator.
Answer:

  • A Relational operator is also called a Comparative operator which checks the relationship between two operands.
  • If the relation is true, it returns True otherwise it returns False.

Question 4.
Write a short note on the comment statement.
Answer:

  • In Python, comments begin with hash symbol (#).
  • The lines that begins with # are considered as comments and ignored by the Python interpreter.
  • Comments may be single line or no multilines.
  • The multiline comments should be enclosed within a set of # as given below.
    # It is Single line Comment
    # It is multiline comment which contains more than one line #

Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

Question 5.
What are the key features of python?
Answer:
Key features of Python:
It is a general-purpose programming language which can be used for both scientific and non – scientific programming
It is a platform-independent programming language.
The programs written in Python are easily readable and understandable

Question 6.
What are the uses of the logical operators? Name the operators.
Answer:

  • In python, Logical operators are used to performing logical operations on the given relational expressions.
  • There are three logical operators they are and or not.
  • Samacheer Kalvi 12th Computer Science Guide Chapter 5 Python -Variables and Operators

III. Answer the following questions (5 Marks)

Question 1.
Explain data types in python?
Answer:
Python Data types:
All data values in Python are objects and each object or value has a type. Python has Built-in or Fundamental data types such as Numbers, String, Boolean, tuples, lists, and dictionaries.

Number Data type:
The built-in number objects in Python supports integers, floating-point numbers, and complex numbers.
Integer Data can be decimal, octal, or hexadecimal. Octal integers use O (both upper and lower case) to denote octal digits and hexadecimal integers use OX (both upper and lower case) and L (only upper case) to denote long integers.
Example:
102, 4567, 567 # Decimal integers
0102, o876, 0432 # Octal integers
0X102, oX876, 0X432 # Hexadecimal integers
34L, 523L # Long decimal integers
A floating-point data is represented by a sequence of decimal digits that includes a decimal point. An Exponent data contains decimal digit part, decimal point, exponent part followed by one or more digits.
Example :
123.34, 456.23, 156.23 # Floating point data
12.E04, 24.e04 # Exponent data
A complex number is made up of two floating-point values, one each for the real and imaginary parts.

Boolean Data type:
A Boolean data can have any of the two values: True or False.

Example:
Bool_varl = True
Bool_var2 = False

String Data type:
String data can be enclosed with a single quote or double quote or triple quote.

Example:
Char_data = ‘A’
String_data = “Computer Science”
Multiline_data= “““String data can be enclosed with single quote or double quote or triple quote.”””