The third line of this code will give an error. How should it be corrected so that no error will
occur? Write out the full, corrected line of code without any spaces.
>>> x=6
>>> y=2
>>> a=4(x+y) correct answers a=4*(x+y)
Write a line of code that creates a variable called "pi" and sets it to 3.14. correct answers pi =
3.14
What does the following program print out?
x=4
x+1
print(x) correct answers 4
The statement count=count+1 is a valid statement in the following code:
>>> count=5
>>> count=count+1 correct answers True
Select all the lines of code that will correctly ask for the user's first name and last name and then
puts them together. Below is an example of the output.
What is your first name?
Carlos
What is your last name?
Salazar
Hello Carlos Salazar! correct answers print("What is your first name?")
firstName=input()
print("What is your last name?")
, lastName=input()
print("Hello " + firstName + " " + lastName + "!")
Correct this code so it will calculate the average of 2, 3, and 6 correctly: print(2+3+6/3) correct
answers print((2+3+6)/3)
What do you need to include in the print() function to tell Python to not move to the next line
after that print() statement is finished? correct answers end=' '
The Python print() function automatically adds what to the end of a line? correct answers new
line
Which two escape characters would you use to print a backslash in Python? correct answers \\
Which two escape characters would you use to print a new line in Python? correct answers \n
Which two escape characters would you use to print a single quote in Python? correct answers \'
Which two escape characters would you use to print a double quote in Python? correct
answers \"
Which two escape characters would you use to print a tab in Python? correct answers \t
True or False? Dot Notation can be used with lower(), upper() or str() string methods. correct
answers false
What method is used to capture string data from the keyboard? correct answers input