Learn

LOLCODE also allows converting string types, or YARNs, to the two numeric types. The syntax is the same: given a variable name, follow it with IS NOW A and the numeric type to convert to.

Converting strings to numbers can be useful when our program receives input using GIMMEH. Inputs are stored as YARNs, so to convert them to numbers, we’ll need to use IS NOW A.

Instructions

1.

Create a variable named purringVolume and read in a value for it.

2.

Convert purringVolume to a floating-point number and print it.

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Already have an account?