NEW
Font size
WorksheetsPython String
Total questions: 9
Worksheet time: 4mins
An example of Python code that creates a variable and assigns it to the string "Hello!"
goodbye = "HAVE A GREAT DAY!"print(goodbye)
welcome = "Hello!"
"Today I had \"pizza"\ for lunch"
print("Hello!" * 3)
When Python sees ________ around text, it reads it as a string
variables
operators
question marks
quotation marks
Say s=”hello” what will be the return value of type(s)?
STRING
bool
str
String
What will be the output of the following Python code?
print("D", end = ' ')
print("C", end = ' ')
print("B", end = ' ')
print("A", end = ' ')
DCBA
A,B,C,D
D C B A
D
C
B
A
What will be the output of the “hello” +1+2+3?
hello123
hello
Error
hello6
What is the output from this code?
ell
llo
ello,
Hello
Each item in a string has an "address" or index. The first index in a Python string is what?
0
1
a
A
