0% found this document useful (0 votes)
36 views4 pages

Python Basics: Data Types & Errors

Uploaded by

VIRESH SUTAR
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)
36 views4 pages

Python Basics: Data Types & Errors

Uploaded by

VIRESH SUTAR
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

if 5 > 2 :

print ( " five is greater than two " )

five is greater than two

if 5 > 2 :
print ( " five is greater than two " )

five is greater than two

x = 5 #Integer
x = " Hi Class " #String
Print ( x )
Print ( y )

----------------------------------------------------------------------
-----
NameError Traceback (most recent call
last)
Cell In[10], line 3
1 x = 5 #Integer
2 x = " Hi Class " #String
----> 3 Print ( x )
4 Print ( y )

NameError: name 'Print' is not defined

a = 5 if 5 > 2 :
p #Integer
b = 0.45 #Floating
c = " AL & ML " #String
d = [ 1,2,3 ] #List
e = { " key " , " value " } #Diectionary

#Integer
num = 478
print ( "Integer " , num )

Integer 478

#Float
decimal = 8.147
print ( "Float " , decimal )

Float 8.147

#String
place = New Delhi
print (" String " , place)

Cell In[23], line 2


place = New Delhi
^
SyntaxError: invalid syntax

#Dictionary
person = {" name " : " Dalia " , " age " : " 20 "}
print ( " Dictionary " , person)

Dictionary {' name ': ' Dalia ', ' age ': ' 20 '}

Numpy

import numpy as np

arr=[Link]( [1,2,3,4,5])
print("Numpy array",arr)

Numpy array [1 2 3 4 5]

import pandas as pd

data ={"Class":["FY","SY","TY"],
"Attn":[32,64,7]}
df = [Link] (data)
print (df)

Class Attn
0 FY 32
1 SY 64
2 TY 7

Matplotlib #Mathematical Plot Library

import [Link] as plt


porosity = [0.4,0.55,0.25,0.10]
permeability = [200,400,100,50]
[Link] (porosity,permeability)
[Link]('Poro-per relationship')
[Link]()
[Link](porosity,permeability,color = ['black','yellow','green'])

<BarContainer object of 4 artists>

You might also like