What symbol is used to make single-line comments in your code?
#
What does adding \n to your code do?
Tells the code to print onto the next line
Which operator lets you test for inequality?
!=
Explain the purpose of the randint() function
Allows us to define a range of numbers and returns a random integer from that range
Name the major steps in the Design Process
Concept, Implementation, Testing
What are these symbols called in programming? //, %, **, +, ==
operators
False:
print(variables)
What is the other name for an "if statement" in python?
Conditionals
What is the purpose of While Loops
While Loops allow us to repeat a line of code and have it executed over and over if the conditional statement is true
True/False: Every project needs to go through repeated testing.
True
What is the difference between an integer and a floating point number?
An integer can only be a whole number, while floating point numbers can include decimals
Write the code to convert data stored in a variable into a string
What allows you to have multiple options for your Conditionals?
Elif/Else statements
True or False: an else statement can be used at the end of a while loop to dictate what happens when the loop is done repeating.
True!
What can you use the Design Process for?
Developing websites, games...anything!
How would you comment out multiple lines of code?
' ' ' (Three apostrophes at the beginning and end of your comment)
Write one line of code asking a user for their favorite color
favColor = input("What is your favorite color?")
If I wanted to replace every "t" in my string with "e" which string manipulation would I use?
string.replace()
True or False: Our while loop can continue to loop even after the conditional statement (hint: what's inside the parentheses) evaluates to false.
False! Our while loops stop repeating as soon as the loop does to start its next repeat and finds that the condition is now false.
Pseudocode is a(n) ________ of the code you plan to make
outline
A variable must start with a ____ or _____.
letter or underscore character
What function would we use to convert from a float to an int?
int()
Look at the following line of code:
Word="9"
Write the code that would convert this string variable into the number 9, then add 3 to it.
int(Word) + 3
What would this code produce:
import random
num = randint(1, 10)
print(num)
Nothing! This would produce a syntax error instead of printing a random number between 1 and 10. Remember that to use the randint() function we must also use the dot operator to let our compiler know where our function was defined, like so: random.randint()
True/False: The implementation step of the design process is where most of our work is done.
True! Consisting of part a, pseudocode, and part b, our actual coding—the implementation step is where we do most of our heavy lifting when we program.