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

Gui design, how to load a video using push button in gui design click

how to load a video using push button in gui design click

Write a schema for the operation of ending a game, QUESTION 1 We need ...

QUESTION 1 We need to write Z specifications to record the information about passengers on board an aircraft. Here you are required to produce the specifications using appropr

Dataflow modeling for dsp design, Dataflow Modeling for DSP Design The ...

Dataflow Modeling for DSP Design The necessary components in the research of application-specific computer architectures are: 1) a clearly identified set of problems that can b

D, #questionWrite a program to find the area under the curve y = f(x) betwe...

#questionWrite a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two poi

System, differance between multiaccess and multitasking

differance between multiaccess and multitasking

What is i-node number, Question 1 Bring out the advantages of Linux Ope...

Question 1 Bring out the advantages of Linux Operating systems Question 2 Match the Symbols with their respective file types              Symbol               File N

Explain the concept of linking and relocation, Question 1 Write an assembl...

Question 1 Write an assembly language program to find the highest among two numbers Question2 Draw and explain the internal architecture of 8085 briefly Question3 Explai

Cpu scheduler, Selects among the processes in memory which are ready to exe...

Selects among the processes in memory which are ready to execute & allocates the CPU to one of them CPU scheduling decisions can be taken place when a process: A. Terminates B. Swi

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