Conversions - Python

From TRCCompSci - AQA Computer Science
Revision as of 10:23, 20 June 2018 by Admin (talk | contribs)
Jump to: navigation, search

Data Type Conversions

Python has built in functions to convert between different data types. To convert something to an integer you would enter:

number = int( textEntered)

or if you wanted to get the input direct from the user you could do this instead:

name = int( input(enter a number) )

Other conversion functions are available:

Conversions in python.png