0% found this document useful (0 votes)
3 views

Brief Overview of Python

Chapter 3 provides an overview of Python with various exercises related to data types, error categorization, and programming tasks. It includes questions on representing data values, identifying errors, and writing simple programs. Additionally, it discusses the differences between 'else' and 'elif' constructs in if statements.

Uploaded by

cr7vk18shourya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Brief Overview of Python

Chapter 3 provides an overview of Python with various exercises related to data types, error categorization, and programming tasks. It includes questions on representing data values, identifying errors, and writing simple programs. Additionally, it discusses the differences between 'else' and 'elif' constructs in if statements.

Uploaded by

cr7vk18shourya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Chapter 3 – Brief Overview of Python

Exercise
Question 1:

Answer:

Question 2:
Write the corresponding Python assignment statements:

Answer:
Question 3:
Which data type will be used to represent the following data values and why?
a) Number of months in a year
b) Resident of Delhi or not
c) Mobile number
d) Pocket money
e) Volume of a sphere
f) Perimeter of a square
g) Name of the student
h) Address of the student
Question 4:
Answer:
Question 5:
Categorise the following as syntax error, logical error or runtime error:
a) 25 / 0
b) num1 = 25; num2 = 0; num1/num2
Answer:

Question 6:
Question 7:
Write a program to repeat the string ‘‘GOOD MORNING” n times. Here n is an
integer entered by the user.

Question 8:
Write a program to find the average of 3 numbers.

Question 9:
Write a program that asks the user to enter one's name and age. Print out a
message addressed to the user that tells the user the year in which he/she will
turn 100 years old.

Question 10:
What is the difference between else and elif construct of if statement?

Question 11:

You might also like