Lesson 1: Python Basics Flashcards

1
Q

What are computers designed to do?

A

Fulfill our commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does communicating with a computer require?

A

It requires an individual to be able to speak their language, (become a programmer)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does a computer “user” view computers?

A

As tools, Ex. word processor, map, note

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does a computer “programmer” utilize computers?

A

They harness computer’s “ways”

They have and use tools that allow them to build new tools

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What impact do programmers have on society?

A
  1. They write tools for users
  2. They write personal “helpers” for efficiency, (to automate a task)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a program?

A

A sequence of stored instructions executing one at a time that shapes computer behavior

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why is coding important?

A
  1. It represents a fragment of our problem - solving skill
  2. It’s a means of sharing insights and discoveries with others
  3. Eliminates the need for others to reinvent the wheel
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the 3 basic instruction types?

A
  1. Input
  2. Process
  3. Output
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is input?

A

The source through which a program obtains data. Such as touchscreens, keyboards, files, and networks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Process?

A

A program carries out calculations on the data.
Ex. adding two values such as x + y

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Output?

A

Where a program stores processed data. Ex. file, screen, network

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a compiled program?

A

Programs that undergo translation into machine code by the compiler before execution.

Ex. C++, Java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a benefit of compiled programs?

A

Faster execution speeds than interpreted programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a limitation of compiled programs?

A

Restricted to running exclusively on the CPU for which they were compiled

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is an interpreted program?

A

Programs that undergo real time translation and execution by the interpreter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a limitation of interpreted programs?

A

Slower execution speeds than compiled programs

17
Q

What is an advantage of interpreted programs?

A

They are platform independent, which means that they can run seamlessly on any compatible system where the corresponding interpreter is present

Ex. Python, JavaScript

18
Q

What are two ways to talk to Python that are used in this course?

A
  1. Interactive Python Interpreter on command line (windows) / terminal interface (mac)
  2. Direct execution of Python (.py) files
19
Q

Which commands allow the current directory to be accessed via the command line / terminal?

A

pwd (mac) / cd (windows)

20
Q

Which commands allows a list of all contents to be accessed via the command line / terminal?

A

ls (mac) / dir (windows)

21
Q

Which commands allows navigation to one level up on command line / terminal?

22
Q

What is a syntax error?

A

An error that occurs when code violates a programming language’s rules for proper grammar.

23
Q

What is a literal?

A

Fixed values such as numbers, letters, strings, and boolean values

Numeric Liteterals: Ex. 15, 9.5

String Literals: Can be enclosed in single quotes Ex. (‘Hello’) or double quotes (“Hello”)

Boolean literals - ‘True’, ‘False’

24
Q

What is a variable?

A

A named place in the memory where a programmer can store data and later retrieve the data using a variable “name”

25
What are the guidelines for naming variables in python?
1. Must start with a letter or an underscore (_) 2. Python is case sensitive 3. Can consist of letters (uppercase and lowercase) numbers, and underscores 4. No spaces or special characters 5. Meaningful and Descriptive 6. Maintain consistent naming conventions
26
What are Reserved Words / Keywords?
Words that have previously been given specific meanings that can't be used as variable names