-
Write a Python statement that prints the word "hello" but does not
advance to the next line.
print("hello", end="")
-
Write a Python statement that prints
1, 2, 4
print(1, 2, 3, sep=", ")
-
Write a Python expression that concatenates the string
"My name is " with the string variable name.
"My name is " + name
-
Write a Python expression that concatenates the string "The rate is " with the
variable rate which is of type
float
.
"The rate is " + str(rate)
-
Write a Python expression that concatenates the string "The distance is " with the
expression
speed * time
"The distance is " + str(speed * time)
-
Write a SINGLE print statement, without using triple quotes, which prints
Line 1
Line 2
Line 3
print("Line 1\nLine 2\nLine 3")
-
Write a SINGLE print statement, without using triple quotes or
concatenation, which prints
The path is C:\temp\memo.txt.
print("The path is C:\\temp\\memo.txt.")
-
Write a SINGLE print statement, without using triple quotes or
concatenation, which prints
She said "I'm OK"
print("She said \"I\'m OK\"")