If you're curious about other functions included in the math library, you can see the full list here.

Sometimes it seems like I'm in the wrong folder in Atom. How do I change folders?

Atom will open in the same folder that you have navigated to in the Terminal window (at the command prompt). If you're unusure of what directory you're in, try running pwd to see what your Present Working Directory is.

Can you do a picture in Python? / Now I want to know how to do pictures.

That's coming up in week 6. We'll get there!

How long should the starting comment be?

It doesn't have to be very long, but it should include enough of a description that you, or someone else who is reading your code, can figure out what the program is supposed to do. It should state the main idea.

** Can we do unit conversions in Python? (eg. pi * (radius of x cm)**2 * height of y cm = cake of z m) **

Yes, just use math! Math works like normal. (So a centimeter is 1/100th of a meter.)

What happens when you try to convert a string without numbers to an int or float?

What a great question! Let's try it on the Python interpreter:

>>>float("octopus")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: could not convert string to float: 'octopus'

... okay, so it gives an error. That seems like what we would expect.

I encourage you to try experiments like this on your own.

I'm wondering how to get long strings of text and variables together in a pretty way

We will talk more about how to deal with strings, and how to print nice-looking output, throughout the semester. For now, if you have some idea of what you want to do, but you don't know how to do it, feel free to ask!

Can you convert a float to a reduced fraction using the math library?

Yes, or at least Python can try to give a reduced fraction. (Your mileage may vary: Python might only give you an approximation.) The as_integer_ratio() functionality will return the numerator and denominator of the best approximation that Python can calculate. This is sometimes good enough, depending on what you are trying to do.

>>>x = 0.125
>>>x.as_integer_ratio()
(1,8)
>>>y = 0.333333
>>>y.as_integer_ratio()
(3002396749180579, 9007199254740992)