Docsity

Python Programming Complete Notes for Beginners - With Codes, Study notes of Computer science

Toggle sidebar
bg1
PYTHON PROGRAMMING - COMPLETE NOTES
1. What is Python?
Python is a high-level, interpreted programming language. Easy to learn.
2. Variables and Data Types:
x = 10 (Integer)
y = 3.14 (Float)
name = "Ali" (String)
is_pass = True (Boolean)
3. Input / Output:
name = input("Enter your name: ")
print("Hello", name)
4. If-Else Condition:
if x > 10:
print("Greater")
else:
print("Smaller")
5. Loops:
For Loop:
for i in range(5):
print(i)
While Loop:
i=1
while i<=5:
print(i)
i+=1
6. Functions:
def add(a,b):
return a+b
print(add(5,3))
7. List, Tuple, Dictionary:
List = [1,2,3] - Mutable
Tuple = (1,2,3) - Immutable
Dict = {"name":"Ali", "age":20}
8. 5 Important Programs with Code:
pf2

Partial preview of the text

Download Python Programming Complete Notes for Beginners - With Codes and more Study notes Computer science in PDF only on Docsity!

PYTHON PROGRAMMING - COMPLETE NOTES

  1. What is Python? Python is a high-level, interpreted programming language. Easy to learn.
  2. Variables and Data Types: x = 10 (Integer) y = 3.14 (Float) name = "Ali" (String) is_pass = True (Boolean)
  3. Input / Output: name = input("Enter your name: ") print("Hello", name)
  4. If-Else Condition: if x > 10: print("Greater") else: print("Smaller")
  5. Loops: For Loop: for i in range(5): print(i) While Loop: i= while i<=5: print(i) i+=
  6. Functions: def add(a,b): return a+b print(add(5,3))
  7. List, Tuple, Dictionary: List = [1,2,3] - Mutable Tuple = (1,2,3) - Immutable Dict = {"name":"Ali", "age":20}
  8. 5 Important Programs with Code:

a) Factorial b) Prime Number c) Fibonacci d) Palindrome e) File Handling This is beginner to intermediate level complete guide.