How do i apply this knowledge to do cooler stuff
We'll do this throughout the semester! Stay tuned.
Conceptualizing the connection between atom and the terminal.
Atom is a text editor -- it's a program, like Microsoft Word or notepad, that lets you edit a file of text. (The .py files we are writing are just that: files of text.) When we want to run that program, we go to the terminal and give the command python3 file.py
to tell the computer that we want to have python3 run the code in that file.
I need to learn how to save my atom programs
I quite agree. Saving your work in this course is an important step.
What do low-level programming languages look like?
Not very readable to humans, if you print them out. But they are very useful in giving fine-grained commands to the computer, so you can have full control on how the computer deals with its memory and disk space, for example. If you're particularly interested, I recommend CS31, but for CS21 we'll stick to nice, readable Python.
why my variable isn't saving
Hmmm. What are you trying? This is the kind of question that would be great to ask me or a ninja, so you can show us what you're trying and exactly what is happening.
Can floats have unlimited number of decimal places, or is it only one?
A float in Python can have a lot of significant digits, but it has some technical limitations. If you want a LOT more details, you can look at [this documentation)(https://docs.python.org/3/tutorial/floatingpoint.html). For now, you should just keep in mind that things like 12.0
and 2.71828
and 0.000001355
are all reasonable floats.
I'd like to know how you print both string and integers in the same command line
Just give them both to the print
command:
>>>print("Number of legs of a standard octopus:",8)
Number of legs of a standard octopus: 8
Python will print all the arguments you give to the print
function, with a space between. So all the data types we've seen --- strings, integers, and floats --- are valid inputs to the print
function.
how to put a space after the input question so it doesn't look weird
Just go ahead and put a space there, right in the string: print("What year do you graduate? ")
.
what is python? is it a magic snake that lives behind computer screens?
... no.