Data Type Conversion, Basic Computer Science

Assignment Help:
Sometimes you may drop to perform conversions among the built-in types. To translate between types you just use the type name as a function.
There are quite a few built-in functions to carry out conversion from one data type to another. These functions return a new object representing the changed value.
Function Description
Converts x to an integer. Base states the base if x is a string.
long(x [,base] ) Converts x to a long integer. Base identifies the base if x is a string.
float(x) Changes x to a floating-point number.
complex(real [,imag]) Generates a complex number.
str(x) Changes object x to a string representation.
repr(x) Changes object x to an expression string.
eval(str) Estimates a string and returns an object.
tuple(s) Changes s to a tuple.
list(s) Changes to a list.
set(s) Translates s to a set.
dict(d) Generates a dictionary. d must be a sequence of (key, value) tuples.
frozenset(s) Translates s to a frozen set.
chr(x) Translates an integer to a character.
unichr(x) Translates an integer to a Unicode character.
ord(x) Translates a single character to its integer value.
hex(x) Translates an integer to a hexadecimal string.
oct(x) Translates an integer to an octal string.

Related Discussions:- Data Type Conversion

Digital transmission, Digital Transmission: In digital transmission, w...

Digital Transmission: In digital transmission, wave patterns are translated into discrete bits and are separated by intervals. Bits (contraction for binary digits) are the sma

RMO CSMS marketing subsystem, I need to write a narrative n overview of the...

I need to write a narrative n overview of the diagram and an analysis of the actors

Communications programs , Communications Programs : By communications prog...

Communications Programs : By communications programs, we mean those programs which allow a computer to communicate via a transmission cable to another electronic device. Here we d

Operating systems, Operating Systems: The operating system is the soft...

Operating Systems: The operating system is the software that mediates between the applications programs and a level of instructions nearer to the machine's operations. In othe

Cp, I NEED FLOW CHART ANT DRAWINGS OF BASIC OPERATIONS OF COMPUTER

I NEED FLOW CHART ANT DRAWINGS OF BASIC OPERATIONS OF COMPUTER

Binary, Ask quwhat is binary estion #Minimum 100 words accepted#

Ask quwhat is binary estion #Minimum 100 words accepted#

Technology, We normally think of the arts as very different from technologi...

We normally think of the arts as very different from technologies in spite of the fact that art (with perhaps a few exceptions) is practiced with the help of technology. This pract

How can we create a fcb file?, Creating a new file For the formation of fil...

Creating a new file For the formation of files the 21H interruption 16H function is used. DX must identify a control structure whose necessities are that as a minimum the logic uni

Flowchart, 1. The volume of a pyramid is taken from the formula: V = 1/3 x ...

1. The volume of a pyramid is taken from the formula: V = 1/3 x AREA OF BASE x ALTITUDE Given the dimensions of a pyramid, calculate the cost of materials for making that pyrami

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd