munotes®

Python Programming Notes | B.Sc. (Information Technology) Semester 3 | Mumbai University | munotes

Get access to whole semester resourcesSemester Pass

Official Notes munotes.in

Python Programming

B.SC. (INFORMATION TECHNOLOGY) · SEMESTER 3

Strictly as per the University of Mumbai NEP syllabus in force for B.Sc. (Information Technology)

For B.Sc. (Information Technology) students of the University of Mumbai and all its affiliated colleges

Open the book ↓

munotes.in Second Year

Contents

Module I Basic Elements of Python Programming

  1. What Python Is, and the Features That Made It Popular 1
  2. Installing Python and Running Your First Program 6
  3. How a Python Program Is Executed: Source, Bytecode and the PVM 10
  4. The Python Interpreter: The Prompt, Script Mode and the Command Line 14
  5. Comments 18
  6. IDLE: The Shell, The Editor and The Debugger 22
  7. The Data Types Python Gives You 26
  8. Numbers: int, float, complex and bool 30
  9. The Dictionary as a Data Type 34
  10. Sets and the frozenset 37
  11. Mapping: What a Mapping Type Is 41
  12. Tokens, Keywords, Identifiers and Literals 44
  13. Statements, Lines and Indentation 48
  14. Variables and What a Name Really Holds 52
  15. Reading What the User Types: The input() Function 56
  16. Output Statements: The print() Function 60
  17. Command Line Arguments and sys.argv 63
  18. Arithmetic Operators 66
  19. Relational Operators and Chained Comparison 70
  20. Logical Operators and Short-Circuit Evaluation 74
  21. Bitwise Operators 78
  22. Assignment Operators 82
  23. Membership and Identity Operators 86
  24. Precedence and Associativity of Operators 90
  25. Control Statements: The Three Kinds Python Has 94
  26. The if Statement 98
  27. The if...else Statement and the Conditional Expression 101
  28. The if...elif...else Statement 105
  29. The while Loop 109
  30. The for Loop and the range() Function 113
  31. The Infinite Loop and The Nested Loop 117
  32. The else Suite on a Loop 122
  33. break, continue and pass 125
  34. The assert Statement 129
  35. The return Statement 132
  36. What an Array Is, and Why a List Is Not One 135
  37. Creating an Array with the array Module 139
  38. Indexing and Slicing an Array 143
  39. Basic Array Operations 147
  40. Processing an Array 151
  41. NumPy and the ndarray 156
  42. Mathematical Operations on an Array 160
  43. Aliasing an Array Against Copying One 165
  44. Slicing and Indexing in NumPy Arrays 170
  45. Basic Slicing of a NumPy Array 174
  46. Advanced Indexing 178
  47. Dimensions and Attributes of an Array 183
  48. Function Definition and Call 188
  49. Returning a Result from a Function 192
  50. Returning Multiple Values from a Function 196
  51. The Built-in Functions 200
  52. The Difference Between a Function and a Method 204
  53. Pass by Object Reference 208
  54. Parameters and Arguments 213
  55. Default and Keyword Arguments 216
  56. *args and **kwargs: Any Number of Arguments 220
  57. Local and Global Scope 224
  58. Recursive Functions 229
  59. Anonymous Functions: The lambda 234
  60. Modules in Python 239
  61. Writing Your Own Module and the __name__ == '__main__' Idiom 244
  62. Creating Strings 249
  63. The Functions and Methods of a String 253
  64. Working with Strings: Indexing, Slicing, Concatenation and Membership 258
  65. Formatting Strings: The f-string 263
  66. Formatting Strings with format() and the Percent Operator 267
  67. Finding the Number of Characters and Words 271
  68. Inserting a Substring into a String 276
  69. Module 1: The Practical Set 280

Module II List

  1. Exploring the List: What Makes It Different 289
  2. Creating a List 293
  3. List Functions and Methods 298
  4. List Operations 303
  5. List Slices 308
  6. Nested Lists and the Matrix 312
  7. Tuples 317
  8. The Functions That Work on a Tuple 321
  9. Creating a Dictionary 325
  10. The Operators That Work on a Dictionary 330
  11. Dictionary Methods 334
  12. Using a for Loop with a Dictionary 339
  13. Operations on Dictionaries 343
  14. Sorting a Dictionary by Value 348
  15. Opening and Closing a File 352
  16. Working with Text Files 356
  17. Reading the Last n Lines of a File 361
  18. Working with Binary Files 365
  19. The with Statement 370
  20. Pickle in Python 374
  21. seek() and tell() 380
  22. Random Access to a Binary File 385
  23. Zipping and Unzipping Files 390
  24. Working with Directories 395
  25. Regular Expressions: An Introduction 401
  26. Sequence Characters in a Regular Expression 407
  27. Special Characters in a Regular Expression 412
  28. Using a Regular Expression on a File 418
  29. Retrieving Information from an HTML File 423
  30. Time in Python: The Epoch and struct_time 428
  31. The date Object 433
  32. The Date and Time Now 438
  33. Combining a Date and a Time 442
  34. Formatting a Date and a Time 446
  35. Finding and Comparing Dates 451
  36. Sorting Dates 457
  37. Knowing the Time a Program Takes 462
  38. Working with the Calendar Module 467
  39. Module 2: The Practical Set 472
  40. Sitting the Paper: Thirty Marks in One Hour 479
munotes.in

The chapters

Every chapter of this book comes with the B.Sc. (Information Technology) Semester 3 notes.

The cover and the contents are free to look through. Buy the notes once to read every chapter of every subject in this semester.

Notes: ₹499 Already bought it? Sign in

Free either way: question papers, the syllabus, and the cover and contents of every book.

The rest of this subject

These notes are cut from the University's printed syllabus. Open the syllabus itself, or the past papers, for the same subject.

Issue
Done!