Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
8 views
17 pages
Data Types
Data types
Uploaded by
shubham sutrave
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save DataTypes For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
8 views
17 pages
Data Types
Data types
Uploaded by
shubham sutrave
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save DataTypes For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save DataTypes For Later
You are on page 1
/ 17
Search
Fullscreen
Data Types 1) Numerical Data types represents whale nunbar (We or = + fost + complex reniy part can be float or tnt (ove on ve) meas mlalay Type casting or type conversion or type coersion. \Unepparted Cl Type. Double cick to inane he cnta putt "enter the age") type) Y atrtoint Dbrire(tbefore type casting variable data type 1s (ype(ay}") # enecking earatype Ba '= ine(ar) 8 type casting DSrinctfratter type casting variable date type Ss (eye(say)") # checking type ore type ating wrkaie fata eye a css sts Y. Tinto float lne((* a= (G) and dota type Ss (typela))") checking datatyoe brine Die Heat(a) # type casting prine(#" 5 = (b} and gata type £5 {ype(by}") # enecking datatype Dbrarc(#" a = (9) and eats type ts (ype(a)}") # checking aatatype prare(o=8) Sie eteat(a) # ype casting prire(# 5 = {b) and gata type £5 (ype(b))") # eneklng datatype = 58 and datatype te class ines¥ 2) float toint 8.8 9 tang user Sraut 3.= (a) and eta type ts (typela))") # checking datatype priretvere). Se tnetad # type casting Dprire(#" 3 = (b} and gata tye £5 Cypetb)3") 8 enecking datatype bbe 58 and data type 18 class “Ine™> prirs(#" a = (3) and asta type tx (type(a)}") # chackng eatatyne brine Be tne(ay # ype casting Dprire(#" a = (b) and aata type £6 {ype(b)}") 8 checking datatype Drine(#" 2 = (a) and gata type ts {typeta)3") # checking datatype brire(os) Se tne(ay © ype casting prine(e” a = (By and asta type Ss (lype(b))") # eneklng datatype 3 x 58.7 and data type is
12'> {a} and cata type As (tyela)}") ¥ checking datatype a) Be tnt(a) # type casting Dprins(i" a = (B) ana asta type 4x (type(0)}") # enecking aststype 2 = 56.9 and data type Is
Yintto complex 22 35 4 taeing user Input ne(#" a (a) and data type Ss {type(a))") # checking eatatyoe priretvere) Ds complex(a) & type casting prire(#” b= (O} and data tye £5 {ypetb)3") 9 enecking datatype b= (503) and date type Is «cla55 “complex > prirs(fe_a = (3) and earn type tx (type(a)}") # chackng aatatyne brine B= conptex(2) ¥ type casting prire(#™ 2 = {b} and gata type Ss {ype(b)}") 8 ehecklng datatype ane dota type As cclass “ine'> bs (250) ane cate type 1s
Y- float to complex. Drire(#" 2 =) and gata toe $5 {type(a))") # checking eatatyoe brire(-s0 Se conplex(a) # type casting prirs(te a = (B} and sata type £s (yp0(B))") # eneklng datatype 2 15:58 and cata type 16 class ‘float’> 2 (Cas sb) ana dots tye a celate “comers Srire(# a= {a} and gata tye {lype(a)}") # checking datatyoe 0) Ds conplex(a) & type carting Dprire(#" 9 = (O) and gata tyoe is (ypetb)3") # enecking datatype boo (15.503) ane cata ype ts celass complex’?Y complex to int 2 35 5 6) # takdng user smut Srine(# 2 (2) and gata type £8 {Lype(a))") # checking aatatyoe prine("*reny Be inctad # type casting rire(#"'9 = (b} ana gata tye £5 (ypetb)3") 8 enecking datatype 1st) ad date type ts class “corplex’> ‘ype eror Traceack (nost recent call Last) “Mfoobats\ocat Teng tpykersel_5748/408n813574.97 18 snodule> Diprint fae {a} ane entnsype in (type) w checking datatye printf © (ef and eta type Ss (type))") 4 checking statyoe Typeterors can't convert compe to Sot Y complex to float a= 15 5 6} # taking user nut Srine(# a= (2) and data type £6 {lype(a)}") # checking aatatyoe brine(nsey B= fost(a) # ype casting rirc(#" 9 = (b) and gata type ts (ypetb)3") # enecking datatype2 = (15005) and data ype Is
Drinc(#" a = (9) and esta type ts (typeta)3") # checking aatatype brare("="8) Da ste(ay # type casting prine(e" a = (Bj and aata type £5 (eype(b)}") # evecking datatype 32 a5 # taking user input Drane(#" 2 = (2) and Gata toe As {type(a))") # checking eatatyoe brire(csey Be ste(a) # type casting prins(#" a = (Bj and asta type Sx (type(b))") # eneking datatype 2 2 15 and cata types class “tne"> bo 4s and data type ts class ‘str"> Y floattostr Dbrire(#" 2 =} and gata toe 4s {type(a))") # cbecing eatatyoe brire(sy Be ate(a) # type casting princté” a = (b) and asta type is (type(b)}") # checking datatype 1 sata ype Se celage ‘flot'> DSrine(# a= {a} and gata tye £5 lypela)}") # checeng aatatyre brine(rereuay Ge ste(a) # type casting Dprinc(#" 9 = (b) ana cara type ts (ypetb)3") # enecking datatypeY. strtoint 27257 taking user drove Grine(é™ a's a) and data type Ls (typeta)}") # checking datatype priretvere Ce tnctad # type casting beire(#" 3 = (b} and eata toe £5 {type(b)3") 9 enecking datatype 5 and ata type 36 class “ints prins(f= 2 = (3) and asta type ts (type(a)}") # checking aatatyne brine Die trea) # type casting prire(#" a = (B) and aata type £6 {ype(b)}") At eheckdng datatype 2 = 15 and data type ts clase "str’> ¥. strtoint Srine(# 2 = (9) and data tyes (ype(a)}") # checeing aatatyoe prinet"*renay Be ine(a) # type casting prirc(#" 9 = (b} and asta tye ts typetb)3") # eneckdng datatype{sar of flont can't convene eiectly into int (a) and ata type 15 (eypelayy") # checeing tative brine("*euy Ss aest(a) # ype casting pranc(t" 9 = (B) and esta type ts (eype(b)}") # enecking datatype brireto=8) Ca tne(e) # type casting prine(#” © = (2) and aata type £8 (ype(e)}") st evecking datatype 2 15 and deta type ss class “sMe'> Y strto oat Ddrins(fo a = (a) and asta type is (ype(a)}") # checking aatatyoe brireto=8) Se eteat(a) # ype casting prire(e” 5 + {b) and gata type £5 (ype(b))") 8 evecking datatype Y_ strto complex. Dprine(f" s'= (a) and asta type ts (ype(a)Y") # checking estate brine("="=8) Oe conplex(a) # type casting prire(#" 2 = (8) and gata type £8 {ype(b)}") 8 eveckdng datatype b= (150) and data ype ts
2215 50} # taking user Soput brire(@™ 3 = (a) and asta type tx (type(a)}") # checking aatatyne brine Die ste(a) # type casting princ(e™ 9 = (b} and cata tye Ls {tyoetb)}") # enecking b= (150) and data type Is
Revision ne co float, str, comptex fr to int, float,conpex { str of float to int directly not posible refer shove example) = Cent (Yeter age valee?)) Srire(fe a = (a) and asta type ts (ype(a)}") # checking aatatyne brine enter age vale 35 Sand. a type Ss ceass “ste"> = evan(inoue(Venter age value?) Srine(f" 2 = (3) and eota type 4s (ype(a)}") # chaceng catatyoe prire("e"y enter ag0 vale 35 Bn 15 ao, ata type 15 class “int'> a = evaltinout(Yeter salary vaie")) Srire(# a's {a} and eata type £5 {ype(a)}") # checking aatatyoe prine(eeay2 (aput( "enter salary vaie")) Drarc(t" 2 = (2) and eata type 25 (type(a)}") # checking aatatype prireto=) enter salary value 15.07 ingut(Yeter story value) prire(f" a (3) and eata type 4x (Kype(a))") # checking eatatyoe brine |= tnefevan(inut( “enter satory vaue'))) Srine(#" a = (2) and aata type ts {ype(a) 9") # checking datatyoe value 15.699 Sa type ir claee ‘ints 4a = ane(evalqinputt“enter salary vaiue"))) 1 peine(#" a {a} and data Gye 1s {LypELAD!) checking datatyoe math cell(5.8) # top rath, #looe5.58) # lowerour s.58,0) ean s.s2588,2) ound. $82088,3) Y. Text Da string is collection of characters surounded with stale or double on triple or single triple or dole triple quotes 2 ahgazbegsh vas" 4) we con rot use single qucte in single quote 2) us con not wie eauble quote in double quate 2 ‘ahjgazbeish cass" Seta) Gr triple on tingle triple on double trople quoter" type)Gr triple on ingle triple on double triple quoter teeta) strt = Python's elas priretstra) Fe “c:users\aanin\Appoata\tocal\Tenp/pyscrrel_5748/398128335.py", Vine 2 stra Pytion'e clas strt = ytnon's classt praretstea) te “Cusers\eansn\appate\Locan\tenstoyiernel_S748/40LA9570.p9", Line 2 stra "bytwora chess" sted = “Pythons clase” escape character \ prinetstra) ytran’s clase strt = "Python's class” escape character \ priretstra) ytron's clase Stet = Python's class" escape character prire(stra) ython’s lassert “Weare Tearaing \2ythor\"* # escape character \ Meare 2earnt priretstray rythont le are Learning “Python” ert «We Vare\" Learning ("eythen\"" t eseape character \e are learning “Python” priretstray We “are? Learning “Python” Stet = We are learning "ython"* # escape character \ Ke are learning "Python" oriretsteay concttions 4) we can ot use single quote in single quote 2) ue Can Rot Use double guste ir double quote stra “ie are Learning Python’ # escape character \_ Weare learning “Python prinetstray Fe “c:users\aanin\Appata\tocat\enpLpycerrel_S748/2751836738.py", Line 1 ‘strane are learning ‘Pytnon'" # escape character \ Ke are learning "ychon" \_ Escape character ert = we 'are\" Lessing ("7ythen\"" cape enaractan \ We are learning “Python” prireesteay thenw_ \nfor new line 4 = "string Ls collection of characters suroune wlth single ov deble or triste or single triple ar double triple qutes” rine) priretoeen) D> "string collection of characters surounée wlth single or dle or triple or nsingle tniple on dosble triple quotes rire) string Ss collection of characters surcunded with single or double or tole or single tne or double tote quotes Y. \tortab = "string Ls collection of characters suroune wlth Single ov deble or teinle or single triple ar double triple ques” rine) priretoeen) D> "string 1s collection of characters surounée wlth single or dle or triple or \esingle tviple on double triple quotes rire) string Ss collection of characters sucsunded with single or double or tote or single tele or cauble tape quotes v Path botht = "€2\0e@79\060312.25,paatypo8” prireqearn) \goecn3en 2225.0 otha = "e/seczez3/2025_12_25,pstatypes™ # Lax path priretparn) £/9eca23/2025 12.25 otatypes patht = "e:\\9oec2023\\2025_12_25staTypes” # windows path oriretpav)s\poecaza 2051225 oataTypes patht = r°E2\9oe2003\2029_12.3 oatatypes" # windows path praretpatm e\oecazs 2051225 oatarypes th = os. event) priretpat) s\onena23\2603_12_25.tatypee os.ntstate(peeny py etecepaint Ieanentae'] | 1) se Sndexing + @123°4.5 ( stares wlth @ fader, read fron Left to right) decult step shzee 2 2) "we Sndexing + -2-} “A'S (starts with 1 dex y road fran ight to 2eft ) default step size 2-1 = ue to access She eanacter from stringseri) sen] seen an} stea{-t} cere seen stea[-28] cee rire (eye) clare ine brire(eypelad) Oeste) eines)
You might also like
Chapter 2. Python Basics
PDF
No ratings yet
Chapter 2. Python Basics
125 pages
Python Notes
PDF
No ratings yet
Python Notes
186 pages
Python Handwritten Notes - 1 To 2
PDF
No ratings yet
Python Handwritten Notes - 1 To 2
36 pages
Python Book
PDF
No ratings yet
Python Book
70 pages
Typecasting in Python
PDF
No ratings yet
Typecasting in Python
6 pages
Python Notes From Basic To Advance
PDF
No ratings yet
Python Notes From Basic To Advance
105 pages
Python - 03 and 04
PDF
No ratings yet
Python - 03 and 04
76 pages
FALLSEM2024-25 BCSE101E ETH VL2024250107671 2024-08-10 Reference-Material-I
PDF
No ratings yet
FALLSEM2024-25 BCSE101E ETH VL2024250107671 2024-08-10 Reference-Material-I
85 pages
Python ? Handwritten Notes
PDF
No ratings yet
Python ? Handwritten Notes
73 pages
CP by Triz
PDF
No ratings yet
CP by Triz
68 pages
Chap2 - Types, Operators & Expressions
PDF
No ratings yet
Chap2 - Types, Operators & Expressions
70 pages
1 Revision of The Basics of Python - 250206 - 202350
PDF
No ratings yet
1 Revision of The Basics of Python - 250206 - 202350
61 pages
Python
PDF
No ratings yet
Python
30 pages
Python Handwritten Notes 1701013067
PDF
No ratings yet
Python Handwritten Notes 1701013067
73 pages
Module 2. Data Types and Data Structures
PDF
No ratings yet
Module 2. Data Types and Data Structures
27 pages
Python Chap 1 and 2
PDF
No ratings yet
Python Chap 1 and 2
70 pages
Lecture1 Py
PDF
No ratings yet
Lecture1 Py
21 pages
Data Types and Operators
PDF
No ratings yet
Data Types and Operators
28 pages
Lbobgdt-03-Intro Programming Python
PDF
No ratings yet
Lbobgdt-03-Intro Programming Python
21 pages
Data Types in Python
PDF
No ratings yet
Data Types in Python
38 pages
Python Unit1
PDF
No ratings yet
Python Unit1
39 pages
Cadurseg Programacion II Clases
PDF
No ratings yet
Cadurseg Programacion II Clases
28 pages
Python Lesson 4 - Data Types
PDF
No ratings yet
Python Lesson 4 - Data Types
29 pages
Python Lesson Two
PDF
No ratings yet
Python Lesson Two
25 pages
Data Types
PDF
No ratings yet
Data Types
18 pages
Data Types
PDF
No ratings yet
Data Types
19 pages
Data Type
PDF
No ratings yet
Data Type
22 pages
Lab 4
PDF
No ratings yet
Lab 4
9 pages
Language Fundamentals: July 11, 2022
PDF
No ratings yet
Language Fundamentals: July 11, 2022
28 pages
Python Sem2
PDF
No ratings yet
Python Sem2
16 pages
Unit - 2 - Data Types, IO, Types of Errors and Control - Structures
PDF
No ratings yet
Unit - 2 - Data Types, IO, Types of Errors and Control - Structures
18 pages
Python Notes String
PDF
No ratings yet
Python Notes String
15 pages
Data Types in Python (Exam-2)
PDF
No ratings yet
Data Types in Python (Exam-2)
8 pages
Python Assignment 01
PDF
No ratings yet
Python Assignment 01
6 pages
(FA3) - Joseph, Daniel - Casting Booleans
PDF
No ratings yet
(FA3) - Joseph, Daniel - Casting Booleans
6 pages
Python Casting
PDF
No ratings yet
Python Casting
10 pages
03 DataAndVariables
PDF
No ratings yet
03 DataAndVariables
24 pages
Programming For Engineers-1 Mae1042 Lesson-6: Introduction To Python-2
PDF
No ratings yet
Programming For Engineers-1 Mae1042 Lesson-6: Introduction To Python-2
20 pages
DATA TYPES Day 1 Notes
PDF
No ratings yet
DATA TYPES Day 1 Notes
8 pages
21CSS101J-U4 Basic Python Data Types
PDF
No ratings yet
21CSS101J-U4 Basic Python Data Types
7 pages
CH 6 Class 11
PDF
No ratings yet
CH 6 Class 11
10 pages
Lab 1
PDF
No ratings yet
Lab 1
7 pages
3 Data Types
PDF
No ratings yet
3 Data Types
7 pages
Lecture Notes 2
PDF
No ratings yet
Lecture Notes 2
4 pages
Numbers - 1 - Jupyter Notebook
PDF
No ratings yet
Numbers - 1 - Jupyter Notebook
8 pages
DocScanner 18 May 2023 12-40 PM
PDF
No ratings yet
DocScanner 18 May 2023 12-40 PM
18 pages
Image To PDF 30-Dec-2024
PDF
No ratings yet
Image To PDF 30-Dec-2024
3 pages
03 Data Types Help
PDF
No ratings yet
03 Data Types Help
2 pages
Class 2
PDF
No ratings yet
Class 2
3 pages
Data Types
PDF
No ratings yet
Data Types
2 pages
Python 2022
PDF
No ratings yet
Python 2022
12 pages
Lec 1
PDF
No ratings yet
Lec 1
3 pages
Day 20 Type Conversion
PDF
No ratings yet
Day 20 Type Conversion
3 pages
Python Cheat Sheet 8 Pages
PDF
No ratings yet
Python Cheat Sheet 8 Pages
8 pages
Data Types in Python
PDF
No ratings yet
Data Types in Python
38 pages
Datatypes
PDF
No ratings yet
Datatypes
4 pages
Basic Python: What We Have Learned From The Above Simple Program?
PDF
No ratings yet
Basic Python: What We Have Learned From The Above Simple Program?
12 pages
Python Programming Lab: Data Types in Python
PDF
No ratings yet
Python Programming Lab: Data Types in Python
24 pages
Resumen Python
PDF
No ratings yet
Resumen Python
13 pages