Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Holidays Homework
Class XII Computer Science
1. What are variables and data types in Python? Explain with suitable example.
2. What are keywords in Python? Explain with suitable examples.
3. What are operators in Python? Explain all operators available in Python.
4. What is input(), eval() and print() functions in Python? Explain each with suitable examples.
5. What are comments in Python? Explain the types of comments in Python with example.
6. Explain with example:
(i) if statement
(ii) if.. else statement
(iii) if..else..if statement
7. What is for loop? Explain with syntax and suitable example.
8. What is while loop? Explain with syntax and suitable example.
9. Write short note on(Definition, Syntax and example):
(i) Strings
(ii) Lists
(iii) Tuples
(iv) Dictionary
10. Write short on :
(i) String Slicing
(ii) List Slicing
(iii) Tuple slicing
11. Write short note (purpose, syntax and example) on the following string methods:
(i) isalpha() (ii) isdigit() (iii) lower() (iv) islower()
(v) upper() (vi) isupper() (vii) Istrip() (viii) Rstrip()
(ix) isspace() (x) istitle() (xi) join() (xii) swapcase()
(xiii) partition() (xiv) ord() (xv) chr()
12. Write short note (purpose, syntax and example) on the following string methods:
(i) cmp() (ii) len() (iii) max() (iv) min()
(v) list() (vi) sum() (vii) appends() (viii) insert()
(ix) sort() (x) remove() (xi) reverse()
13. Write short note (purpose, syntax and example) on the following string methods:
(i) cmp() (ii) len() (iii) max() (iv) min()
(v) tuple()
14. Write short note (purpose, syntax and example) on the following string methods:
(i) cmp() (ii) len() (iii) str() (iv) type()
(v) clear() (vi) copy() (vii) keys() (viii) update()
If Text[i].isupper():
ntext=ntext+Text[i].lower()
elif Text[i].isalpha():
ntext=ntext+Text[i].upper()
else :
ntext=ntext+ ‘%%’
print(ntext)
27. How many times is the word ‘Hello’ printed in the following statement?
s= ‘ Class XII rocks’
for ch in s{3:8]:
print (‘Hello’)