How do you format a print statement?
print("")
How do you format a comment?
#type anything here : )
...an example of an input.
Keyboard, mouse, etc...
What is input?
Data that the computer takes in.
Explain the logic behind the print statement.
How do you format user input?
input("")
What is the error?
Print('hi')
The capital P
...an example of an output.
Screen, printer, etc...
What is output?
Data that the computer gives out.
Explain the logic behind how a user input variable works.
The user is asked the prompt, the input is then saved in the variable.
How do you format the changing of a data type?
int(), str(), or float()
What is the error?
_greeting1 = "HI, THERE"
print (_greeting1)
There is no error.
...the five rules for variables / variable naming
1) cannot be a keyword
2) Cannot contain spaces
3) 1st character cannot be a number
4) Can only have letters, numbers, and underscores.
5) Variables are case-sensitive.
What is a function?
A body of prewritten code that performs the same operation once called.
Explain the logic behind string concantenation.
When two strings are added together through a "+" sing, the two strings are combined.
How do you format an escape character?
\n , \t , \' , \" , \\
What is the error?
name = Jhonny
print("Hi there", \t, name)
The escape characters go inside the string literals.
...the five components of a computer.
1) input
2) output
3) CPU
4) Main Memory
5) Secondary memory
What does string concatenation mean?
The combination or addition of two strings.
Explain the logic behind escape characters.
Once the computer detects a backlash in the print statement, it reads what is after the backlash, performs the intended action, and then continues outputting the output.
How do you format custom end characters?
print("something", "something", end = ".")
How do you format the statement that checks the datatypes of a variable?
print(type(variable))
...a low-level language
Binary language/ machine language
What are escape characters?
Special characters proceeded by a backlash that appear inside a string.
You are brave.
Choose one. Answer the question for 500 or retreat and receive 100 points.
Question: What does the ^ format specifier specify in f-strings?
That the placeholder will be centered.