Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Python in One Shot

Rating
-
Sold
-
Pages
8
Uploaded on
29-12-2022
Written in
2022/2023

These are easy and short notes of python. Their will be no doubt after study these notes. It is easy to understand notes . Its your call now whether master python by taking this notes or waste your time and money in some meaning less things.

Show more Read less
Institution
Course

Content preview

Python in One Shot


Why to Use Python?
Python can be used for :
1. Programming (for Placements/online contests/DSA)
2. Development (using a backend framework called Django)
3. Machine Learning / Data Science / Artificial Intelligence

Websites built using Python include Google, Youtube, Instagram, Netflix, Uber &
much more.

What to Install?
1. Python (https://www.python.org/)
2. PyScripter (https://rb.gy/bvnn69 )
3. PyCharm (https://www.jetbrains.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 converion functions
# 1. float()
# 2. bool()
# 3. str()
# 4. 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.upper())
print(name)

print(name.lower())
print(name)

print(name.find('y'))
print(name.find('Y'))
print(name.find("Stark"))
print(name.find("stark"))

print(name.replace("Tony Stark", "Ironman"))
print(name)

Written for

Institution
Course

Document information

Uploaded on
December 29, 2022
Number of pages
8
Written in
2022/2023
Type
Class notes
Professor(s)
Richard
Contains
All classes

Subjects

$10.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
shishupalsinghbhati

Get to know the seller

Seller avatar
shishupalsinghbhati Banglore University
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions