0% found this document useful (0 votes)
0 views2 pages

Class 11 CS HHW

The document is a computer science assignment consisting of various questions related to Python programming concepts. It includes tasks such as identifying invalid identifiers, explaining dynamic typing, evaluating expressions, and correcting code snippets. Additionally, it requires writing programs to handle student fees and character classification.

Uploaded by

game.boy0539
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)
0 views2 pages

Class 11 CS HHW

The document is a computer science assignment consisting of various questions related to Python programming concepts. It includes tasks such as identifying invalid identifiers, explaining dynamic typing, evaluating expressions, and correcting code snippets. Additionally, it requires writing programs to handle student fees and character classification.

Uploaded by

game.boy0539
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/ 2

Computer Science

Assignment
1. Find the invalid identifier(s) from the following. Justify
a. If b. else c. none d. str
2. The non executable statement given in a python program to explain different
segment of the program
a. Expression b. jump statement
c. functions d. comments
3. What is the output of the expression 3*2**3?
a. 24 b. 216
c. 18 d. 81
4. Explain the use of id() with example.
5. What is Dynamic Typing in Python? Explain its use with example.
6. Explain Dry run, Algorithm , explicit type conversion.
7. Explain the use of pass statement with the help of a suitable example.
8. Evaluate the following expressions. Also show the steps of evaluation.
a. a // b * c ** 2 – b
when a= 7, b=3, c=5
b. x < y or z != x+y and not y > z
when x=9, y=4, z=6
9. Give the output for the following code.
n1, n2 = 10, False
n1 + = n2 and 100
n2 = bool(n1)
if n1:
print ("Python", end=" ")
elif n2 >= 0:
print("C++”)
print("Programming”)
10. Give the output of the following code:
b = int (27/4)
c, d= b % 4, b + 2
e, f = 3+c**2, 2*c
f -= b + c
print (b, c , e , f , sep="*")
11. Predict the output of the following code:
p=8
if p < 10 or p > 9 and p != 6:
print("correct")
if p >= 2:
print ("no solution")
else:
print("exit")
12. Rewrite the corrected code for the following. Also underline the corrections.
a=input(“Enter the number”)
if a>4 and <10:
print(“Range is between 5 and 9”)
elif a=10:
print(‘Value is 10”)
else
Print(“Range not specified”)
13. Write a program to input the student id, percentage and the category .
Assign the monthly fees on the basis of the category as follows:
Category fees_per_month
P 500
S 800
SS 1000
If the percentage of student is more than 90, an extra discount of 1000 Rupees
is given. Calculate and display the total charges = fees_per_month * 12 – discount.
14. Write a program to input a character. Check whether it is an alphabet, digit or
special character. If it is an alphabet check whether it is a vowel or a consonant
.If it is a digit, check whether it is divisible by 5 ,otherwise display it is a special
character.

You might also like