wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

python String and comment

Total questions: 13

Worksheet time: 7mins

Name
Class
Date
1.

What is a variable?

a)

a vaible answer

b)

something you want the computer to remember

c)

python

d)

syntax error

2.

My_name = "Awesome"

My_name in this string is...

a)

a variable

b)

syntax

c)

my name

d)

prompt

3.

in Python what is the addistion sign?

a)

=

b)

+

c)

^

d)

"

4.

a # in Python means the user is trying to...

a)

hashtag

b)

ratio

c)

comment

d)

tic-tac-toe

5.

what is a string in Python?

a)

a long piece of woven material

b)

text, or keyboard characters

c)

something that ties words together

d)

yarn

6.

How To Write Comment on Python ?

a)

Comments starts with a # for one line

b)

Start and End with (triple quotes) for multiline Comments

c)

Comments starts with a // for one line

d)

Comments starts with a ' for one line

7.

This is Sample of ?

a)

Multi Line Comment

b)

Single Line Comment

c)

Number Value

d)

String Value

8.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
9.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
10.

What will the output be from the following Python code?

print(Hello world!)

a)

Hello world!

b)

SyntaxError

c)

Hello world

d)

print(Hello world!)

11.

The correct syntax for converting the string x to uppercase is :

a)

X.upper()

b)

upper(x)

c)

x.UPPER[ ]

d)

x.upper()

12.

The correct syntax for converting the string myname to lowercase is :

a)

myNAME.lower[ ]

b)

myname.lower( )

c)

myname.upper( )

d)

myname_lower(12 )

13.

Let x= "Python", the output of print(x.upper()) is

a)

python

b)

PYTHON

c)

_PYTHON

d)

"PYTHON"