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

What is Multilevel Feedback Queue Scheduling?, • Multilevel feedback queue...

• Multilevel feedback queue-scheduling algorithm enables a process to move among queues. It uses a number of ready queues and acquaintances a dissimilar priority with every queue.

Difference between an html and an xhtml page, QUESTION (a) Define four ...

QUESTION (a) Define four special target names use with the TARGET attribute (b) Explain the main difference between an HTML and an XHTML page (c) Give two merits and two

Software engineering, 158.254 Software Development Lifecycle Management Ass...

158.254 Software Development Lifecycle Management Assignment 1 This assignment focuses on requirements engineering. The context to this assignment is the development of a system

Assembly Language Project, Our instructor gave us a project in making a mec...

Our instructor gave us a project in making a mechanical game or simple device using assembly language, can anyone give me a an example of a project description for our proposal?

Help with this question, In a certain word game a player can buy vowels and...

In a certain word game a player can buy vowels and consonants. The first vowel is free; each additional vowel cost $1. The first two consonants are free; each additional constant c

Assignment, write an essay explaining the following: 1.Storage aspects a. D...

write an essay explaining the following: 1.Storage aspects a. Disk formatting, b.Disk boot block ,c.Bad block removal, d.Compensation.

Electronic mail , Electronic mail is another PC to PC and PC to mainframe ...

Electronic mail is another PC to PC and PC to mainframe data exchange. If you subscribe to an electronic mail service, it will enable your PC to gain access to a 'mailbox' on a ma

Explain kinematics modeling in virtual reality, Question 1 How can you cre...

Question 1 How can you create surface with 3D Scanner in geometric modeling? Question 2 Explain kinematics modeling in virtual reality Question 3 Describe object hierarc

Explain erlang family of distributions of service times, Question 1 Explai...

Question 1 Explain the structure of Mathematical Model in your own words Question 2 Describe Erlang family of distributions of service times Question 3 Describe the algo

Hypertext transfer protocol (http), It's a common protocol or "language" co...

It's a common protocol or "language" computers use to "speak" to each other over the Web.

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