Login using Social Account
     Continue with GoogleLogin using your credentials
We can also use certain built-in functions to convert one data type to another. For eg,
int
- It takes any value and converts it to an integer, if it can, or returns the error.
int(23.45)
It returns 23. Try converting the string "cloudxlab" to int and see the result.
float
- It converts integers and strings to floating-point numbers.
float(2)
It returns 2.0
str
- It converts its argument to a string
str(123)
It returns '123'
8.9
and store it in the variable square_area
square_area
in square_area_type
square_area
into int and store it in square_area_int
square_area_int
into str and store it in square_area_str
You can use the print function to see the values of your variables.
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...