1.1. Exercises
Name That Data Type
For the next few questions, name the data type of each value.
Coding questions
Instructions:
Running a coding exercise for the first time could take a bit of time for everything to load. Be patient, it could take a few minutes.
When you see ____ in a coding exercise, replace it with what you assume to be the correct code. Run it and see if you obtain the desired output. Submit your code to validate if you were correct.
String Verbs
How many times do the lyrics “Let it be” occur in the Beatles Hit song of the same title?
Tasks:
- Use some of the string verbs you learned in the lecture to count all the times “let it be” (all upper and lower case versions) appears in the string
lyrics. - Save it in an object named
letitbe_count.
Casting Data Types
How can we cast from a string to an integer value?
Tasks:
- Convert
string1to afloatin an object namedpi. - Convert the object
pinow into anintnamedpi_slice.