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

Conditional statement, Conditional statement: An If statement is comp...

Conditional statement: An If statement is composed of three parts. The first part should be keyword w.r.t language to convey to the computer that it is if statement. And a Bo

Liquid crystal displays, Liquid Crystal Displays (LCD): First introduc...

Liquid Crystal Displays (LCD): First introduced in watches and clocks in the1970's, LCDs are now used to display images in monitors. A newer technology in computer screens is

Basic computer structure, Basic computer structure: A computer is an el...

Basic computer structure: A computer is an electronic device, which can accept and process data by carrying out a set of stored instructions in sequence. This sequence of math

Advantages and disadvantages of e-learning, Advantages and Disadvantages of...

Advantages and Disadvantages of E-Learning: Before we discuss about advantages and disadvantages of e-learning, you should know that e-learning is just another model for learn

Comments in Python, A hash sign (#) that is not within a string literal beg...

A hash sign (#) that is not within a string literal begins a comment. All characters later than the # and up to the physical line end are division of the comment, and the Python in

Uninformed search strategies, Uninformed Search Strategies: To be able ...

Uninformed Search Strategies: To be able to undertake a regular search, our entire agent ought to know is the starting state, the possible operators and how to check whether th

In-door patient department, In-door Patient Department Ideally all ...

In-door Patient Department Ideally all features of OPD.  Both OPD and IPD modules should be inter-linked.  In addition all details pertaining to the patient's medica

Perverse software, Perverse software: Perverse software is a program w...

Perverse software: Perverse software is a program which causes hindrances in other programs execution in such a way resulting in modification or complete destruction of data w

Write separate programs for each of the above points, Question 1 Describe ...

Question 1 Describe the following with respect to creating Web Forms in .Net environment- Web Form Life Cycle Creating a Web Form Write programs with corresponding

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