Rename this notebook with your last name, first initial and the (2 digit) lecture number.
ex. Cych_B_02
Turn in this notebook on Canvas.
Conceptual
Insert a markdown cell into your practice notebook and answer the questions:
Why are descriptive variable names useful?
What are reserved words and why can't you use them as variable names?
Variables
Insert a code cell into your practice notebook
In it, define a variable that stores the value of pi (3.1415)
Define a variable called radius, that stores any floating point number (radius)
Define a string that stores "is the circumference of a circle with radius"
Operations
Insert another code cell into your practice notebook.
Calculate the circumference of a circle using the variables you defined earlier and store the answer in a separate variable.
print your new variable.
Changing variable types
Convert all your variables (circumference and radius) into strings
Use the + operator to add them together to make this string:
circumference is the circumference of a circle with radius of radius
boldface words are your new strings].
Strings and string operation
Define a variable with the value:
"Scripps Institution of Oceanography"
Print out the first 7 characters
print indices 8 to 19
Print index 23 to the end
Putting it all together
Create an integer variable depth and set it to 6
Create a string variable planet and set it to “Earth”
convert the variable depth into a string
Create a variable ocean_depth and set it to the string: “The average ocean depth on Earth is 6 km” by using the variables depth and planet instead of Earth and 6