Python Fundamentals Assessment

Python Fundamentals Assessment

University

10 Qs

quiz-placeholder

Similar activities

uas-siber

uas-siber

University

10 Qs

Round 2 for Preplacement Bootcamp

Round 2 for Preplacement Bootcamp

University

15 Qs

Internet

Internet

University

11 Qs

Teste python- Unesp-Jaboticabal

Teste python- Unesp-Jaboticabal

University

10 Qs

PSSI Chp 1 dan 2

PSSI Chp 1 dan 2

University

12 Qs

TES AWAL MODUL 2

TES AWAL MODUL 2

University

10 Qs

Components of GIS & Levels/Scales

Components of GIS & Levels/Scales

University

12 Qs

Computer and Network Security

Computer and Network Security

University

10 Qs

Python Fundamentals Assessment

Python Fundamentals Assessment

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Abdiel Vega

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. What data type does Python assign to the value "123"? a) int b) float c) str d) bool Answer: c) str

list

c) str

float

int

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. Which of the following operators has the highest precedence in Python? a) Logical operators b) Comparison operators c) Arithmetic operators d) Assignment operators Answer: c) Arithmetic operators

c) Arithmetic operators

Bitwise operators

Identity operators

Membership operators

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3. How do you perform type conversion from a string to an integer? a) int("123") b) float("123") c) str(123) d) int.to("123") Answer: a) int("123")

int(123)

float(123)

str.to(123)

a) int("123")

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. What does the following code output? a = [1, 2, 3] print(a[1]) a) 1 b) 2 c) 3 d) Error Answer: b) 2

0

4

b) 2

1

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. Which statement is used for conditional branching in Python? a) switch b) goto c) if d) while Answer: c) if

c) if

loop

select

case

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. What will the following code output? if 5 > 3: print("True") else: print("False") a) "True" b) "False" c) None d) Error Answer: a) "True"

True or False

5 > 3

True

True and False

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

7. What is the correct syntax to open a file for writing in Python? a) open("file.txt", "w") b) open.write("file.txt") c) file.open("w", "file.txt") d) open("file.txt", "r") Answer: a) open("file.txt", "w")

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

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

file.write('file.txt')

open(file.txt, 'w')

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?