0% found this document useful (0 votes)
26 views6 pages

Xi Assignment - Python Fundamentals

The document contains assignments for Class XI Computer Science students at N.K. Bagrodia Public School, focusing on Python fundamentals for the session 2024-25. It includes programming tasks such as calculating the area of a triangle, converting temperature, and various exercises on variable names and expressions. Additionally, it covers topics like arithmetic and logical operators, valid identifiers, and data types in Python.

Uploaded by

sans happyfamily
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)
26 views6 pages

Xi Assignment - Python Fundamentals

The document contains assignments for Class XI Computer Science students at N.K. Bagrodia Public School, focusing on Python fundamentals for the session 2024-25. It includes programming tasks such as calculating the area of a triangle, converting temperature, and various exercises on variable names and expressions. Additionally, it covers topics like arithmetic and logical operators, valid identifiers, and data types in Python.

Uploaded by

sans happyfamily
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/ 6

N.K.

BAGRODIA PUBLIC SCHOOL SECTOR-4, DWARKA


CLASS: XI
SUBJECT: COMPUTER SCIENCE/INFORMATICS PRACTICES
UNIT NAME: COMPUTATIONAL THINKING & PROGRAMMING -1
CHAPTER NAME: PYTHON FUNDAMENTALS
ASSIGNMENTS FOR THE SESSION 2024-25
ASSIGNMENT NO: 1
1. Write a program To Find Area of Triangle.

2. Write a program To Accept Temperature In Celsius( Convert To


Fahrenheit ) Formula:(C*9/5+32=F)

3. Write a program To Swap (Interchange) The Values Of Two Variables


(With And Without Third Variables.

4. Write a program To Accept Marks in Three Subjects and Print It’s Total
and Average.

5. Write a program To Accept Student Name, Class, And Mark Of IP And


print It In Same And Then Three Different Lines.

6. Write a program To Accept Number N And Print N(Power 2 ), N(Power 3 ),


N (Power 4).

7. Write a program To Find Simple Interest.

8. Write a program To Find out the Profit Bear by the Seller.

9. Write a program To Find out the Loss Bear by the Seller.

10. Write a program To Find out the Perimeter of Rectangle.

11. Write a program To Find Circumference of Circle.

12 Write a program to print the ‘memory address‘ and “Data type “of a
number accepted from the user.

13. Write a program to accept a character and print it’s corresponding


ASCII code and vice versa.
N.K. BAGRODIA PUBLIC SCHOOL SECTOR-4, DWARKA
CLASS: XI
SUBJECT: COMPUTER SCIENCE/INFORMATICS PRACTICES
UNIT NAME: COMPUTATIONAL THINKING & PROGRAMMING -1
CHAPTER NAME: PYTHON FUNDAMENTALS
ASSIGNMENT NO: 2

1. Which of the following is an invalid variable name?


a) My Book b) MyBook
c) myBook d) mY_BooK
2. Which of the following is an invalid variable name?
a) INR b) K_D
c) 5_Riyals d) Dollars
3. Which of the following is an invalid variable name?
a) PenandPencil b) Pen_andPencil
c) Pen&Pencil d) none
4. Which of the following is an invalid variable name?
a) true b) false
c) TrueFalse d) True
5. Which of the following is an invalid variable name?
a) cust_name b) cust.name
c) custName d) _CUSTNAME
6. Which of the following is/are invalid variable name(s)?
a) print b) int
c) float d) int float
7. Which of the following can be a valid variable name:
a) a keyword b) a built-in identifier
c) a number d) None of these
8. What will be the values of a and b after execution of the following
statement:

a,b=10
a) a=10 and b=10 b) a=10 and b=0
c) a=0 and b=10 d) The given statement is
incorrect

9. What will be the values of a and b after execution of the following


statement:
a,b=10,20

a) a=10 and b=10 b) a=20 and b=20


c) a=10 and b=20 d) The given statement is
incorrect
N.K. BAGRODIA PUBLIC SCHOOL SECTOR-4, DWARKA
CLASS: XI
SUBJECT: COMPUTER SCIENCE/INFORMATICS PRACTICES
UNIT NAME: COMPUTATIONAL THINKING & PROGRAMMING -1
CHAPTER NAME: PYTHON FUNDAMENTALS
ASSIGNMENTS FOR THE SESSION 2024-25
ASSIGNMENT NO: 3
1. What will be the values of aand b after execution of the following code
segment:
a,b=10,20
a+=b
b+=a
a) a=10 and b=10 b) a=30 and b=20
c) a=30 and b=30 d) a=30 and b=50
2. What will be the values of aand b after execution of the following code
segment:
a,b=10,20
a=+b
b+=a
a) a=20 and b=20 b) a=20 and b=40
c) a=40 and b=20 d) The given code has an
error
3. What will be the values of aand b after execution of the following code
segment:
a,b=5,15
a+=b
b=a-b
a-=b
a) a=5 and b=15 b) a=15 and b=5
c) a=10 and b=-10 d) The given code has an
error
4. What will be the values of aand b after execution of the following code
segment:
a,b=5,15
a+=a+b
b-=a-b
a) a=25 and b=5 b) a=5 and b=25
c) a=20 and b=-10 d) a=20 and b=10

5. What will be the values of aand b after execution of the following code
segment:
a,b=1,2
a*=a+b
b//=a-b
a) a=2 and b=3 b) a=2 and b=2
c) a=3 and b=3 d) a=3 and b=2
6. What is the value of the following expression?
int(12.8)
a) 12 b) 13
c) 12.8 d) Error

7. What is the value of the following expression?


int(12.3+5)
a) 12 b) 17
c) 17.3 d) Error
8. What is the value of the following expression?
int('12.3+5')
a) 12.3 b) 12
c) 17.3 d) Error
9. What is the value of the following expression?
float(12.8)
a) 12.8 b) 12
c) 13 d) Error
10. What is the value of the following expression?
float('12.8')
a) 12.8 b) 12
c) 13 d) Error
11. What is the value of the following expression?
float('12.3+5')
a) 12.3 b) 12
c) 17.3 d) Error

12. What is the value of the following expression?


float(12.3+5)
a) 12.3 b) 12
c) 17.3 d) Error
N.K. BAGRODIA PUBLIC SCHOOL SECTOR-4, DWARKA
CLASS: XI
SUBJECT: COMPUTER SCIENCE/INFORMATICS PRACTICES
UNIT NAME: COMPUTATIONAL THINKING & PROGRAMMING -1
CHAPTER NAME: PYTHON FUNDAMENTALS
ASSIGNMENT NO: 4
1 . Which of the following is a valid arithmetic operators in Python.
(i) // (ii) ? (iii) < (iv) and

2. Which of the following operator(s) are valid logical operators


(i) Like (ii) and (iii) or (iv) is

3. What will be the output of following expressions:


(i) 7/2 (ii) 7//2

4. If given A=20, B=15, C=30, What will be the output of following


expression:
print((A>B) and (B>C) or (C>A))

5 . What will be the output of following expressions:


(i) 15//2 (ii) 15%2

6. What will be the output of following expression:


2**2**4
7. Write the type of tokens from the following
(i) If (ii) roll_no
8. Identify the valid identifier(s) from the given list:
Marks1, $Roll, Avg Marks, IF, _sales2008, while, name

9. Identify the invalid identifiers from the given list:


Average, RegNo. , break, Sales_Q1

10. Write the datatype of following literals:


(i) 100 (ii) False

11. Write the datatype of following literals:


(i) 50.7 (ii) “India”
12. What will be the output of following code:
print(print(10))

You might also like