Python Fundamentals Assessment

Python Fundamentals Assessment

University

10 Qs

quiz-placeholder

Similar activities

Wrażenia globlne w Linxie

Wrażenia globlne w Linxie

10th Grade - University

10 Qs

PYTHON PROGRAMMING

PYTHON PROGRAMMING

University

10 Qs

DDP1 - Strings and Text Files

DDP1 - Strings and Text Files

University

6 Qs

C_Basic.c

C_Basic.c

University

13 Qs

Part 2 - Command Line

Part 2 - Command Line

University

10 Qs

Command Line

Command Line

12th Grade - Professional Development

9 Qs

Coding and Logic (Mitchell)

Coding and Logic (Mitchell)

KG - Professional Development

10 Qs

Linux CLI

Linux CLI

University

11 Qs

Python Fundamentals Assessment

Python Fundamentals Assessment

Assessment

Quiz

Computers

University

Hard

Created by

Abdiel Vega

FREE Resource

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')

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?