Sitemap
Vardhavikas

Vardhavikas

TYPE CONVERSION

2 min read5 days ago

--

Type conversion is a technique using which we can convert a type of the data from one type to another type

Type conversion are of two types

  • Implicit Type conversion
  • Explicit Type conversion
Press enter or click to view image in full size

Implicit Type Conversion: when the Type Conversion is done by python engine automatically converts one type to another type is called Implicit Type Conversion.

  • Explicit Type Conversion: when programmer forcefully converts one type to another type is called Explicit Type Conversion
  • int( ) gives integer value Example: 10
  • float( ) gives float value Example :2.4
  • complex( ) gives complex value Example:6+0j

STRING

string is sequential data type

Get Vardhavikas’s stories in your inbox

Join Medium for free to get updates from this writer.

string is sequence of characters or Elements presents in n single quote ‘ ’, duble quote “ ”, triple quote “‘ ”’

Press enter or click to view image in full size

Properties Of String

  • String is a sequential data
  • String is a Imutable data

strings are of Two Types

Mutable : In this Data can add Data,Replace Data , Delete Data

Imutable:In this No Adding ,No Replacing ,No Deletion only data is happens .

Properties Of String:

  • It is a sequential data
  • They are immutable
  • Every Character has to it’s own adress (index value)
  • String has positive index values also has negative index values
  • Postive index values star from 0,Negative index values start from -1

--

--