You are on page 1of 6

your expectations from the training

your ratings in python (out of 10)


your overall experience in programming
location

Aditya - Algorithm, ML / 8 out of 10/R and python


Akshat - ML algos/2 out of 10/3 yrs of programming SAS, R SQL
Mugdha - ML algos/1 out of 10/6 yrs experience SAS, R, SQL
Saikat - using python for 1.5 yrs, 5/SAS and R
Abhilash - ML /2 out of 10/ Ruby
Ahmed - ML /2/ java and c++
Anand - ML concepts aware/1 out of 10/C,C++
Anu - 10 yrs exp/0/ no exp in programming
Arthur - ML, algos/ 2 out of 10/ 7.5 years experience in data analytics/ exp in
SQL
Arun - 2 out of 10
Benjamin - Ruby/1 yr exp/
Jay - new to programming
mithun - 2 yrs in perl and oracle/2 out of 10
Sudhir - 3 out of 10 on python; 14 years analystics & consulting / exp in SAS, SQL
pavan - 10 ys Exp/ 0 exp on Python/ Work on DWH and BI tools - SQL server, Oracle,
MicroStrategy, Power BI
yogesh - has 5 years experience in java & big data(scala, kafka)
-----------------------------------------------------------------------------------
--------------------
python
----------------------------------------
1. open source
2. number of lines of code is 1/3 the lines of code in Java or C++
we save programmer's time and energy
we save disk space, codes are smaller in nature
we can easily maintain and debug the code
3. easy syntax, more like a english language
4. 4 major libraries made python popular
pandas - data analystics - data wrangling
numpy - numerical analystics - statistical / mathematical problems
matplotlib - for plotting graphs
sklearn - machine learning - all about predictive analysis
5. beautifulsoup - used for web scrapping
6. Django - used for web development
7 boto3 - for connectivity with AWS server
8 python has got 65000 Libraries for any kind of a domain

-----------------------------------------------------------------------------------
--
ways by which we can run python programs
-----------------------------------------------------------------------------------
-
1. install python in your machine
use notepad to write code
run on command prompt

2. install anacondas which will give you 2 tools to write program


https://www.anaconda.com/products/individual
jupyper notebook - ipynb files will be created
spyder - IDE

3. Pycharm - from the company jetbrains - IDE - play button


4. use IDLE interpreter which comes with the installation of python

-----------------------------------------------------------------------------------
---------
rules of programming in python
------------------------------------------------------------
1. we dont have to declare datatypes in python
2. 4 ways of giving comments in python

----------------------------------------------
__author__='Abhaya Agrawal'

# line comment
# this is my first program

'''
this is
a block
comment
'''

"""
this is again
a block comment
in multiple
lines
"""

a=10
b=20
c=a+b
print("sum of a and b is : ", c)
-------------------------------------------------------------
3. indentation rules
whenever we start any block - if, else, for, while, def, class, try, except,
else
you need to give one tab to signify the starting of the block
all of your code must start from 0th column.
if you want to start a block give if : or while: or else: and give a tab in next
lineto
start the block

a=10
b=20
c=30

if a<b:
print("a is less than b")
print("success")
if b<c:
print("b is less than c")
print("again success")
else:
print("b is greater or equal to c")
print("failure again")
else:
print("a is greater or equal to b")
print("failure")
print("bye") #this line is not a part of any block
-----------------------------------------------------------------------------------
---
Question

write a program to find area and perimeter of a circle when radius is 5 cm

in python " " and ' ' are same

Question
---------------------------------------
if cp=5 and sp=10 find if its a profit or a loss or no profit no loss

if condition

elif condition

elif condition

else

there is no case statement in python

-------------------------------------------------------------------
cp=5
sp=12
if cp<sp:
print("Profit", sp-cp)
elif cp>sp:
print("Loss",cp-sp )
else:
print("No Profit, No Loss")

-----------------------------------------------------------------------
and - for and all the conditions has to be true
or - if any single condition is true, ans is true

10 20 6
find the greatest number among them without using max function

a=10
b=20
c=6
if a>b and a>c:
print("a is greatest")
elif b>a and b>c:
print("b is greatest")
elif c>a and c>b:
print("c is greatest")
else:
print("Some Number is same")

a=10
b=20
c=30

if a<b:
print("a is less than b")
print("success")
if b<c:
print("b is less than c")
print("again success")
else:
print("b is greater or equal to c")
print("failure again")
else:
print("a is greater or equal to b")
print("failure")
print("bye") #this line is not a part of any block

------------------------------------------------------------------
in ver 2.x of python there two ways of taking input from the user

1. input() - can take int, floats


2. raw_input() - takes only strings

in ver 3.x there is only one function called input


which can take only strings
if we want to input integers we need to typecast with int
if we want to input floats we need to typecast with float

name=input("enter your name ")


age=int(input("enter your age "))

if age>18:
print(name, " you are an adult as your age is ", age)
else:
print(name, " you are not yet adult as your age is ", age)

------------------------------------------------------------------------
Question

take any number from the user and print its table

3 X 1 = 3
3 X 2 = 6
3 X 3 = 9
..
..
...
3 X 10 = 30

number = int(input("Enter the number"))


count = 1
print ("Table of ",number," is:")
while count <= 10:
#print(number," x ",count," = ", number*count)
print(f'{number} X {count} = {number*count}')
count = count + 1
print ("end of table")

count=1
while count<=10:
print(count)
count+=1
print("bye")

You might also like