python basic

python basic

Professional Development

21 Qs

quiz-placeholder

Similar activities

Python_2R

Python_2R

KG - Professional Development

20 Qs

Python basics

Python basics

Professional Development

22 Qs

Python

Python

Professional Development

20 Qs

Quiz1_8B

Quiz1_8B

3rd Grade - Professional Development

20 Qs

Python AA

Python AA

Professional Development

20 Qs

Examen de Python

Examen de Python

Professional Development

20 Qs

Python Quiz For Starters

Python Quiz For Starters

3rd Grade - Professional Development

17 Qs

Python Programming - Test 1

Python Programming - Test 1

University - Professional Development

20 Qs

python basic

python basic

Assessment

Quiz

Computers

Professional Development

Medium

Created by

KEERTHI BADUGU

Used 6+ times

FREE Resource

21 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is used to create a single-line comment in Python?

  • a) // This is a comment

  • b) # This is a comment

  • c) /* This is a comment */

  • d) <!-- This is a comment -->

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid variable name in Python?

  • a) 1variable

  • b) variable1

  • c) variable-1

  • d) variable 1

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a mutable data type in Python?

  • a) tuple

  • b) list

  • c) str

  • d) int

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for an if statement in Python?

  • a) if x == 10 then:

  • b) if (x == 10):

  • c) if x == 10:

  • d) if x = 10:

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you create an infinite loop in Python?

  • a) while (true):

  • b) while True:

  • c) for(;;):

  • d) while (1):

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you define a function in Python?

  • a) function my_function():

  • b) def my_function():

  • c) define my_function():

  • d) func my_function():

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to open a file for reading in Python?

  • a) open('filename', 'r')

  • b) open('filename', 'w')

  • c) open('filename', 'rw')

  • d) open('filename', 'read')

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?