Customer Service Chat
Get quote & make Payment
Data Type Conversion, Basic Computer Science
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.
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.
Posted Date: 5/5/2012 3:59:55 AM | Location : United States
Ask an Expert
Data Type Conversion, Assignment Help, Ask Question on Data Type Conversion, Get Answer, Expert's Help, Data Type Conversion Discussions
Write discussion on Data Type Conversion
Your posts are moderated
Write your message here..
Data buses, Data buses: The availability of reliable digital semi-condu...
Data buses: The availability of reliable digital semi-conductor technology has enabled the inter-communication task between different equipment to be significantly improved. P
Nano programing, Nano programming using microcontrol and circuits
Nano programming using microcontrol and circuits
Process killed, 1. What actions need to be taken when a program terminates ...
1. What actions need to be taken when a program terminates or a process is killed? What if that process destruction is not the consequence of normal termination, but rather is the
Give a preliminary design for the mobile phone, Question: Imagine that ...
Question: Imagine that you are part of a design team creating a new mobile phone for people such as "Angel White" whose persona is given below: Angel is turning 90 years old
Unix/linux, I need someone to help me with my Unix/Linux homework.
I need someone to help me with my Unix/Linux homework.
Qbasic, write a program of circle of any colour
write a program of circle of any colour
Probability, Mike sells on the average 15 newspapers per week (Monday – Fri...
Mike sells on the average 15 newspapers per week (Monday – Friday). Find the probability that 2.1 In a given week he will sell all the newspapers  2.2 In a given day he will sel
Java programming, what are the phases of oo progarmming or java?
what are the phases of oo progarmming or java?
Algorithms and flowcharts, write algorithm and draw flowchart to check whet...
write algorithm and draw flowchart to check whether the given number is palindrome or not
Unix, How do I change file permissions? Every time I execute chmod commands...
How do I change file permissions? Every time I execute chmod commands it tells me permission denied.
Accounting Assignment Help
Economics Assignment Help
Finance Assignment Help
Statistics Assignment Help
Physics Assignment Help
Chemistry Assignment Help
Math Assignment Help
Biology Assignment Help
English Assignment Help
Management Assignment Help
Engineering Assignment Help
Programming Assignment Help
Computer Science Assignment Help
Why Us ?
~24x7 hrs Support
~Quality of Work
~Time on Delivery
~Privacy of Work
Human Resource Management
Literature Review Writing Help
Terms & Conditions
Copyright by ExpertsMind IT Educational Pvt. Ltd.