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

Python Basics Notes

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)
14 views2 pages

Python Basics Notes

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

Python Basics Notes for Beginners

Compiled by: Study Resource Team

For academic use only


Introduction
Python is a beginner-friendly programming language widely used in AI, web, and data science.

Hello World Program


print('Hello World')

Variables & Data Types


x = 5 (int), y = 'hello' (string), z = 3.14 (float).

Control Structures
if, else, elif, for loops, while loops.

Functions
def greet(name): return 'Hello ' + name

Lists & Dictionaries


fruits = ['apple', 'banana']
info = {'name': 'Yashodhan', 'age': 25}

File Handling
with open('file.txt','r') as f: data = f.read()

Mini Exercise
Write a program to add two numbers entered by the user.

You might also like