Python Programming Quiz

Python Programming Quiz

University

28 Qs

quiz-placeholder

Similar activities

Neo Coding Round 1 Set 2

Neo Coding Round 1 Set 2

University

25 Qs

Python 1

Python 1

University

30 Qs

programming quiz

programming quiz

University

25 Qs

JAVA WEEK 7-12

JAVA WEEK 7-12

University

25 Qs

Teknoloji ve Yazılım 1. Dönem 1. Yazılı (Python)

Teknoloji ve Yazılım 1. Dönem 1. Yazılı (Python)

6th Grade - University

24 Qs

DEBUGGING

DEBUGGING

University

26 Qs

Introduction to Python

Introduction to Python

KG - University

25 Qs

python-2

python-2

University

23 Qs

Python Programming Quiz

Python Programming Quiz

Assessment

Quiz

Computers

University

Hard

Created by

Abdiel Vega

Used 2+ times

FREE Resource

28 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What data type does Python assign to the value "123"?

int

float

str

bool

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following operators has the highest precedence in Python?

Logical operators

Comparison operators

Arithmetic operators

Assignment operators

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you perform type conversion from a string to an integer?

int("123")

float("123")

str(123)

int.to("123")

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code output? python Copy code a = [1, 2, 3] print(a[1])

1

2

3

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement is used for conditional branching in Python?

switch

goto

if

while

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output? python Copy code if 5 > 3: print("True") else: print("False")

"True"

"False"

None

Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to open a file for writing in Python?

open("file.txt", "w")

open.write("file.txt")

file.open("w", "file.txt")

open.file("file.txt", "write")

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?