FAQ: Data Types - Putting it All Together

so im guessing you cant square 1 you have to try other numbers

I tried other numbers but it doesn’t do anything. I don’t even know what this exercise wants me to do. This is so frustrating.

Hello there!

This exercise lets you play around with different variable values and functions so that you can get a better grasp of data types. First, run the code as is. Then, you can play around with the interactive area on the right, selecting different functions from the dropdown and clicking the “Transmit!” button. You will see the result of each function displayed on the image of the computer screen in the interactive area on the right.

The exercise also asks you to try changing the values of myNumber, myString, and myBool to see how different values could affect how the functions run. The same goes for data types; you can change the data types of the variables to see how the functions are affected. After making changes, simply press Run again and play around with the interactive area on the right.

6 Likes

Thank you, These are helpful. I wish the lessons had instructions this clear, most people are smarter than me so maybe it’s not important. I’ll try these with the excercise.

Why has the bug where if the number is set to 1 an error results not been fixed after so long? It’s discouraging to new learners who wouldn’t understand that it’s a bug in the program.

The bug is currently being worked on. You can see the bug report here, which will be updated once it has been resolved.

it is mentioned that string is either denoted by ‘…’ or “…” but i have entered '…"still it is capitalizing. why so ? please clarify

it is mentioned that string is either denoted by ‘…’ or “…” but i have entered '…"still it is capitalizing. why so ? please clarify

it will also work if you try othaer numbers than 150 but after editing the number there is option below RUN . click on it .and it will work

Yes, strings, depending on the programming language, can either be denoted by '', "", or both. However, both the opening and closing quotation mark must be of the same type. For example, 'Hello!' and "Hello!" would both be valid, while 'Hello!" would not.

Welcome to the forums!

1 Like

I changed the values and I am just getting a “Loading” message in the screen on the right of my code. Is this an error with the system?

Welcome to the forums!

It’s working for me, try reloading the webpage. If that doesn’t work, try resetting the exercise.

1 Like

Thank you I think its because I did not reload the page. I appreciate your help!

1 Like

I am in need of help, I am following the instructions and it will not give me the check mark of completion. :frowning:

Part 1 :
myNumber = 175;

myString = ‘bye’;

myBool = false;

Part 2 I switched out the data type and nothing.

Thank you in advance.

Welcome to the forums! Make sure you press the Run button after changing a value.

1 Like

Hi guys! Question: why the functions are not within quotes?

Functions are special objects which we write in text, obviously, but they are not string data. They need to written without quotes so the interpreter can recognize and parse them as functions, not string data.

What we don’t see under the hood is that a function’s name is type string, but we still don’t put it in quotes. It is a property of its container object.

@mtf Roy thanks a lot for your reply!

1 Like

I tried making mynumber=‘ANT’ and then pressing the capitalize button but it didn’t work? I thought the " myNumber" and " myString" are just the names of variables and as such shouldn’t matter ?

1 Like

It doesn’t matter what we call our variables, that is correct. However, the lesson checker has expectations that we must meet. In this case, using camelCase to indicate the joining of the two words into one name.