1/41
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is a shell/terminal?
a program that takes commands from your keyboard and gives them to your computer to execute. It is an allows you to interact with your computer directly without using the graphical user interface
What is a GUI?
A graphical user interface
Historically, did computers have graphical user interfaces? What kind of interfaces did they have?
Historically, computers only had command line operating systems
What are the three main computer operating systems?
Apple (Mac), Linux, and Windows
Why would you want to interact with your computer using a terminal?
It allows you to do things that are not possible to do with a GUI, and some commands are easier or faster to run from command line
What is pwd and how to use it?
pwd - prints out the directory you are in. Example: pwd
What is ls and how to use it?
ls - lists the contents of the directory you are in. Example: ls
What is cd and how to use it?
cd - change directory. Example: cd Desktop
What is mkdir and how to use it?
mkdir - makes a new directory. Example: mkdir Turtle
What is cp and how to use it?
cp - copy file. Example: cp test.txt test2.txt
What is mv and how to use it?
mv - move or rename a file. Example: mv turtle.py wiggles.py
What is rm and how to use it?
rm - delete a file or directory. Example: rm -r Test
What is a program?
a sequence of instructions that specifies how to perform a computation or action
What five things do programs have in common?
They get input, they give output, they check certain conditions, repetition, math
What is computer programming?
the process of designing and building a program to accomplish a specific computing task
What is a programmer?
Someone who writes computer programs
What is an IDE?
Integrated development environment. Allows you to write and run your code all in one application
What is Syntax (in the context of computer programming?)
Using the right commands and punctuation in the right order to get the computer to understand what you want it to do
What are programming languages?
Programming languages allow us to provide instructions to our computer in a way it can understand and execute
What are High level programming languages?
High level programming languages - designed to be user oriented and make it straightforward for the user to write programs
What are low level programming languages?
Low level programming languages: machine oriented. Expressed in terms of the machine operations that must be performed to carry out a task. This makes it much harder for users to write programs
What are comments and what are they used for?
Lines of non-executed code used throughout a program for documentation purposes. Typically used to: state the name of the program or programmer and the date, explain the purpose of the program, keep track of revisions, and anything else you think is helpful to the user
How do you make single line comments?
#this is a single line comment
How do you make multi-line comments?
use three double quotes, """text""" """This Is a Comment"""
Print() function: what are the different ways of making print statements? Single line vs multi line
Single line: Print("hello world"); Multi line: use tree double quotes """text""" Print("""multiple lines""")
What will \n and \t do?
\n makes a new line in a comment \t makes a new tab
How do you include " " in a print statement? Provide an example
Using the escape character; print("He said \"hi\" to me")
What is debugging?
Fixing errors in programs
What is a syntax error?
A syntax error occurs when a character (symbol, letter, or number) is placed incorrectly in a line of code
What is a logic error?
A logic error is an error that occurs when the program still runs but it operates incorrectly or does not produce the desired output
How do you import the turtle module?
import turtle
How do you name a turtle?
wiggles = turtle.Turtle()
How do you make your turtle go forward?
wiggles.forward(100)
How do you make your turtle turn right?
wiggles.right(35)
How do you make your turtle turn left?
wiggles.left(15)
How do you make your turtle change color?
wiggles.color("green")
What command must be placed at the end of all your turtle programs?
turtle.done()
%Harry Potter #September 1 1993 #My first program
#Harry Potter #September 1 1993 #My first program
print(I like defense against the dark arts)
print("I like defense against the dark arts")
print("I have an owl named Hedwig
I like to play quidditch
I am a seeker")
print("""I have an owl named Hedwig
I like to play quidditch
I am a seeker""")
print("I have Transfiguration \t first thing in the morning") print("Hagrid told me "do not go into the Forbidden Forest" ")
print("I have Transfiguration \t first thing in the morning") print("Hagrid told me \"do not go into the Forbidden Forest\" ")
import turtle
wiggles = turtle.Turtle wiggles.left(25) wiggles.forward("80")
wiggles.backward(10)
wiggles_right(17)
wiggles.color(green)
wiggles.forward(90)
wiggles.left(18)
wiggles.backward{22}
wiggles.color("black")
forward(28)
backward(15)
wiggles.done()
import turtle wiggles = turtle.Turtle () wiggles.left(25) wiggles.forward(80) wiggles.backward(10) wiggles.right(17) wiggles.color('green') wiggles.forward(90) wiggles.left(18) wiggles.backward(22) wiggles.color("black") wiggles.forward(28) wiggles.backward(15) turtle.done()