0% found this document useful (0 votes)
4 views

basic_python_notes

This document provides basic notes on Python programming, covering its introduction, syntax, variables, data types, input/output, control structures, functions, lists, dictionaries, classes, and comments. Key features include the importance of indentation, various data types, and basic object-oriented programming concepts. Examples are provided throughout to illustrate each topic.

Uploaded by

boniganesh812
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 views

basic_python_notes

This document provides basic notes on Python programming, covering its introduction, syntax, variables, data types, input/output, control structures, functions, lists, dictionaries, classes, and comments. Key features include the importance of indentation, various data types, and basic object-oriented programming concepts. Examples are provided throughout to illustrate each topic.

Uploaded by

boniganesh812
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
You are on page 1/ 3

Basic Python Notes

1. Introduction

- Python is a high-level, interpreted programming language.

- Known for readability and simplicity.

2. Basic Syntax

- No need for semicolons or braces.

- Indentation is important (uses whitespace).

3. Variables and Data Types

- int, float, str, bool, list, tuple, dict, set

- Example:

x=5

name = "Rishi"

is_active = True

4. Input and Output

- input() for input, print() for output

- Example:

name = input("Enter your name: ")

print("Hello,", name)

5. Control Structures

- if, elif, else


- for loops, while loops

- Example:

for i in range(5):

print(i)

6. Functions

- Defined using def keyword.

- Example:

def greet(name):

print("Hello", name)

7. Lists

- Ordered, mutable collections.

- Example:

fruits = ["apple", "banana", "cherry"]

8. Dictionaries

- Key-value pairs.

- Example:

person = {"name": "Rishi", "age": 20}

9. Classes and Objects

- Basic OOP concepts.

- Example:

class Car:

def __init__(self, brand):


self.brand = brand

def honk(self):

print("Beep!")

10. Comments

- Single line: #

- Multi-line: ''' ''' or

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy