0% found this document useful (0 votes)
4 views1 page

Programming Python Compact Cuttings

The document outlines key concepts in Python programming, categorized into three parts. Part A covers basic operations, data types, and object-oriented principles. Parts B and C discuss comparisons with C, Python's execution model, operators, and string manipulation methods.

Uploaded by

cxm6tv6fxz
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)
4 views1 page

Programming Python Compact Cuttings

The document outlines key concepts in Python programming, categorized into three parts. Part A covers basic operations, data types, and object-oriented principles. Parts B and C discuss comparisons with C, Python's execution model, operators, and string manipulation methods.

Uploaded by

cxm6tv6fxz
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

PROGRAMMING IN PYTHON - EXAM CUTTINGS

PART A (2 Marks)
1. Sum of two numbers:
a=int(input()); b=int(input()); print("Sum=",a+b)
2. Escape: \n, \t, \\, \', \", \r, \b
3. Module: Single .py file. Package: Collection of modules.
4. math module for calculations.
5. num=int(input()); print(num)
6. if num>0:Positive elif num<0:Negative else:Zero
7. array() stores same datatype values.
8. Strings store & process text.
9. Function: outside class. Method: inside class.
10. _var(protected), __var(private).
11. super() calls parent method.
12. Method overloading via default arguments.

PART B (5 Marks)
13. Python: interpreted, easy, OOP. C: compiled, fast, procedural.
14. << multiply by 2, >> divide by 2.
15. print("Hello"); print("Sum=",10+20)
16. Nested loop: loop inside loop.
17. NumPy: numerical & array library.
18. Formal arguments: parameters in function definition.
19. Local: inside function. Global: outside function.
20. Constructor: __init__() initializes object.
21. Use super().__init__() in inheritance.

PART C (15 Marks)


22. Execution: Source Code → Bytecode → PVM → Output.
23. Operators: Arithmetic, Relational, Logical, Assignment, Bitwise, Membership, Identity.
24. Array ops: access, insert, delete, traverse, slice.
25. String case: upper(), lower(), title(), capitalize(), swapcase().

You might also like