W3Schools Python Quiz

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

20 Terms

1
New cards

What is a correct syntax to output "Hello World" in Python?

print("Hello World")

2
New cards

How do you insert COMMENTS in Python code?

#This is a comment

3
New cards

Which one is NOT a legal variable name?

my-var

4
New cards

What is the correct file extension for Python files?

.py

5
New cards

What is the correct syntax to output the type of a variable or object in Python?

print(type(x))

6
New cards

What is the correct way to create a function in Python?

def myFunction();

7
New cards

In Python, 'Hello', is the same as "Hello"

True

8
New cards

Which operator is used to multiply numbers?

*

9
New cards

Which operator can be used to compare two values?

==

10
New cards

Which of these collections defines a LIST?

["apple", "banana", "cherry"]

11
New cards

Which of these collections defines a TUPLE?

("apple", "banana", "cherry")

12
New cards

Which of these collections defines a SET?

{"apple", "banana", "cherry"}

13
New cards

Which of these collections defines a DICTIONARY?

{"name" : "apple", "color" : "green"}

14
New cards

How do you start writing an if statement in Python?

if x > y:

15
New cards

How do you start writing a while loop in Python?

while x > y:

16
New cards

How do you start writing a for loop in Python?

for x in y:

17
New cards

Comments in Python are written with a special character, which one?

#

18
New cards

To verify the type of any object in Python

type()

19
New cards

What character does Float use to indicate the power of 10.

e

20
New cards

what character does complex numbers are written with?

j