Intro to Computer Programming

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/41

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

42 Terms

1
New cards

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

2
New cards

What is a GUI?

A graphical user interface

3
New cards

Historically, did computers have graphical user interfaces? What kind of interfaces did they have?

Historically, computers only had command line operating systems

4
New cards

What are the three main computer operating systems?

Apple (Mac), Linux, and Windows

5
New cards

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

6
New cards

What is pwd and how to use it?

pwd - prints out the directory you are in. Example: pwd

7
New cards

What is ls and how to use it?

ls - lists the contents of the directory you are in. Example: ls

8
New cards

What is cd and how to use it?

cd - change directory. Example: cd Desktop

9
New cards

What is mkdir and how to use it?

mkdir - makes a new directory. Example: mkdir Turtle

10
New cards

What is cp and how to use it?

cp - copy file. Example: cp test.txt test2.txt

11
New cards

What is mv and how to use it?

mv - move or rename a file. Example: mv turtle.py wiggles.py

12
New cards

What is rm and how to use it?

rm - delete a file or directory. Example: rm -r Test

13
New cards

What is a program?

a sequence of instructions that specifies how to perform a computation or action

14
New cards

What five things do programs have in common?

They get input, they give output, they check certain conditions, repetition, math

15
New cards

What is computer programming?

the process of designing and building a program to accomplish a specific computing task

16
New cards

What is a programmer?

Someone who writes computer programs

17
New cards

What is an IDE?

Integrated development environment. Allows you to write and run your code all in one application

18
New cards

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

19
New cards

What are programming languages?

Programming languages allow us to provide instructions to our computer in a way it can understand and execute

20
New cards

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

21
New cards

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

22
New cards

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

23
New cards

How do you make single line comments?

#this is a single line comment

24
New cards

How do you make multi-line comments?

use three double quotes, """text""" """This Is a Comment"""

25
New cards

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""")

26
New cards

What will \n and \t do?

\n makes a new line in a comment \t makes a new tab

27
New cards

How do you include " " in a print statement? Provide an example

Using the escape character; print("He said \"hi\" to me")

28
New cards

What is debugging?

Fixing errors in programs

29
New cards

What is a syntax error?

A syntax error occurs when a character (symbol, letter, or number) is placed incorrectly in a line of code

30
New cards

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

31
New cards

How do you import the turtle module?

import turtle

32
New cards

How do you name a turtle?

wiggles = turtle.Turtle()

33
New cards

How do you make your turtle go forward?

wiggles.forward(100)

34
New cards

How do you make your turtle turn right?

wiggles.right(35)

35
New cards

How do you make your turtle turn left?

wiggles.left(15)

36
New cards

How do you make your turtle change color?

wiggles.color("green")

37
New cards

What command must be placed at the end of all your turtle programs?

turtle.done()

38
New cards

%Harry Potter #September 1 1993 #My first program

#Harry Potter #September 1 1993 #My first program

39
New cards

print(I like defense against the dark arts)

print("I like defense against the dark arts")

40
New cards

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""")

41
New cards

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\" ")

42
New cards

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()