Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

You have nothing in your shopping cart yet.

Title: python
Description: basic infomation about python

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


Python in One Shot
This video has been made with a lot of love & I hope you guys have an amazing programming journey :)

Why to Use Python?
Python can be used for :
1
...
Development (using a backend framework called Django)
3
...

What to Install?
1
...
python
...
PyScripter (https://rb
...
PyCharm (https://www
...
com/pycharm/)
Our First Python Program
print("Hello World")

A Key Point to know about Python
- It is a case sensitive language

Variables
Basic Types in Python - numbers(integers, floating), boolean, strings
Example 1 :
name = "shradha"
age = 22
print(name)
print(age)

Example 2 :
name = "shradha"
age = 22

name = "aman"
age = 24
print(name)
print(age)

Example 3 :
first_name = "shradha"
last_name = "khapra"
age = 19
is_adult = True
print(first_name + " " + last_name)
print(age)
print(is_adult)

> Exercise Solution
first_name = "Tony"
last_name = "Stark"
age = 52
is_genius = True

Taking Input
name = input("What is your name? ")
print("Hello " + name)
print("Welcome to our cool Python class")

> Exercise Solution
superhero = input("What is your superhero name? ")
print(superhero)

Type Conversion
old_age = input("Enter your age : ")
#new_age = old_age + 2
#print(new_age)
new_age = int(old_age) + 2
print(new_age)

#Useful
# 1
...

# 3
...


converion functions
float()
bool()
str()
int()

> Code for Sum of 2 Numbers

first_number = input("Enter 1st number : ")
second_number = input("Enter 2nd number : ")
sum = float(first_number) + float(second_number)
print("the sum is : " + str(sum))

Strings
name = "Tony Stark"
print(name
...
lower())
print(name)
print(name
...
find('Y'))
print(name
...
find("stark"))
print(name
...

numbers = range(5)
print(numbers)

For iteration (see For Loop section)
While Loop
i = 1
while(i <= 5):
print(i)
i = i + 1
i = 1
while(i <= 5):
print(i * "*")
i = i + 1
i = 5
while(i >= 1):
print(i * "*")
i = i - 1

For Loop (to iterate over a list)
for i in range(5):
print(i)

i = i + 1
for i in range(5):
print(i * "*")
i = i + 1

Lists
List is a complex type in Python
...
append("physics")
marks
...
insert(0, "math")
marks
...
clear()
print(marks)
i = 0
while i < len(marks):
print(marks[i])
print(marks[i+1])
i = i + 2

Break & Continue
students = ["ram", "shyam", "kishan", "radha", "radhika"]

for student in students:
if(student == "radha"):
break
print(student)
for student in students:
if(student == "kishan"):
continue
print(student)

Tuples
They are like lists (sequence of objects) but they are immutable i
...
once they have been
defined we cannot change them
...

marks = (95, 98, 97, 97)
#marks[0] = 98
print(marks
...
index(97))

Sets
Sets are a collection of all unique elements
...

marks = {98, 97, 95, 95}
print(marks)
for score in marks:
print(score)

Dictionary
Dictionary is an unordered collection of Items
...

marks = {"math" : 99, "chemistry" : 98, "physics" : 97}
print(marks)
print(marks["chemistry"])
marks["english"] = 95
print(marks)
marks["math"] = 96
print(marks)

Functions in Python

Function is a piece of code that performs some task
...
In-built functions
# int() str() float() min() range() max()

b
...

Each module should contain some related tasks
Example : math, random, string
import math
print(dir(math))
import random
print(dir(random))
import string
print(dir(string))
from math import sqrt
print(sqrt(4))

c
...
youtube
...
gy/gjpmwg (A Python GUI)
Some useful Modules


https://github
...
com/Embarcadero/DelphiVCL4Python


Title: python
Description: basic infomation about python