What is python?
Functions
Syntax
Variables
And the Output is?
Data Types
10 Decisions
100

What is python?

Python is a popular programming language.

100

for i in _________(5):

range

100

Python syntax can be executed by writing directly in the Command Line:

>>> print("Hello, World!")
Hello, World!

100

How can you create a variable?

A variable is created the moment you first assign a value to it.

100

forward(100)

right(90)

forward(100)

right(90)

forward(100)

right(90)

forward(100)

right(90)

What is a square

100

"str" is an example of...

Text Type

100

The Binary number system is based on this number.  Called Base "___ "

2

200

What can Python do?

  • Python can be used on a server to create web applications.
  • Python can be used alongside software to create workflows.
  • Python can connect to database systems. It can also read and modify files.
200

In Python, you can set conditions and have the program execute code according to what meets the conditions.  What type of function are these?

Example:

What is conditionals

200

Or by creating a python file on the server, using the .py file extension, and running it in the Command Line:

C:\Users\Your Name>python myfile.py

200

What are variables?

Variables are containers for storing data values.  

200

print(9 + 1 * 3 - 2)

What is 10

200

DAILY DOUBLE

"int", "float" and "complex" are examples of...

Numeric Types

200

Convert to Binary:

31

11111

300

We can use python for....

  • web development (server-side),
  • software development,
  • mathematics,
  • system scripting.
300

DAILY DOUBLE


how do you obtain information from the user

input()

300

What is Python Identation?

Indentation refers to the spaces at the beginning of a code line.

300

The number of variables in this problem

What is one.

300

for i in range(3):    

     pat.forward(100)

Pat will move over ___ Pixels

What is 300

300

5.0

float

300

212

11010100

400

Compared to other programming languages...

  • Python was designed for readability, and has some similarities to the English language with influence from mathematics.
400

What does "calling a function" mean?

When you ask a function to perform what it has been defined to do. 

print(5) is a function call

is_senior(65) is a function call

400

What does python use identation for?

Python uses indentation to indicate a block of code.

400

What can you do with the type() function?

You can get the data type of a variable with the type() function.

400

DAILY DOUBLE

x is 32?

if x > 12:

    print("large")

else:

    print("small")

What is large

400

TRUE

boolean / bool

400

Convert to Base 10:

11010100

44

500

What are some common errors that people make when writing programs?

Answers may vary:

Adding spaces between numbers

Forgetting a parentheses

Not checking data type when doing operations

Forgetting a colon

Indenting incorrectly


500

def word_multiplier(word, mult_num):

return word * mult_num


print(word_multiplier("Yes", 5))


What would it print? What are the parameters? Where is the function call? What is the function header? What is the function body? What is the function input?

The answer would print:

YesYesYesYesYes


500

Use the same number of spaces in the same block of code, otherwise

Python will give you an error

500

What can single or double quotes do?

String variables can be declared either by using single or double quotes:

500

def mystery( a, b ):
    return a + b

n = mystery(2, 3)
m = mystery("french ", "fries")
print(n, m)

What is 5 french fries

500

word5andnum63r5

string

500

10100111001

1337

9999

What is the output of the following code if the user enters 5:

def findSquare(num = 10):
    return num * num

num = input("Enter a number: ")
mySquare = findSquare()
print(num, "squared is", mySquare)

5 squared is 100

This is tricky but function was defined with num = 10.  The input statement never went into findSquare() function.