W3Schools Python Quiz

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

How do you insert COMMENTS in Python code?

#This is a comment

Which of these collections defines a TUPLE?

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

Which operator is used to multiply numbers?

*

What is the correct file extension for Python files?

.py

Which operator can be used to compare two values?

==

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

e

Which of these collections defines a SET?

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

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

#

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

True

Which of these collections defines a LIST?

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

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

def myFunction();

How do you start writing a for loop in Python?

for x in y:

How do you start writing an if statement in Python?

if x > y:

what character does complex numbers are written with?

j

Which one is NOT a legal variable name?

my-var

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

print("Hello World")

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

print(type(x))

To verify the type of any object in Python

type()

How do you start writing a while loop in Python?

while x > y:

Which of these collections defines a DICTIONARY?

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


Kaugnay na mga set ng pag-aaral

soc midterm- Latent Functions of Education

View Set

ENTR 187 - Entrepreneurship - Sac State - Dr. VanVo

View Set

Env Chem - Unit 2 Greenhouse Effect Review

View Set

Chapter 18: Care of Patients with Arthritis and Other Connective Tissue Diseases

View Set

Money & Banking Chapter 5 The Structure of Interest Rates

View Set