python basic

python basic

Professional Development

21 Qs

quiz-placeholder

Similar activities

Basics of programming - Quiz - 01

Basics of programming - Quiz - 01

University - Professional Development

20 Qs

DATATYPES - INPUT/OUTPUT - OPERATORS

DATATYPES - INPUT/OUTPUT - OPERATORS

Professional Development

24 Qs

Python Interaction

Python Interaction

9th Grade - Professional Development

20 Qs

Bertelsmann AI Track Quiz Initiative #3

Bertelsmann AI Track Quiz Initiative #3

University - Professional Development

20 Qs

LIST-TUPLES-SET-DICTIONARY

LIST-TUPLES-SET-DICTIONARY

Professional Development

25 Qs

Python NOC 1 - Q

Python NOC 1 - Q

Professional Development

21 Qs

SPARK FIDDLE

SPARK FIDDLE

Professional Development

20 Qs

Linguagem e Orientação a Objetos

Linguagem e Orientação a Objetos

Professional Development

20 Qs

python basic

python basic

Assessment

Quiz

Computers

Professional Development

Medium

Created by

KEERTHI BADUGU

Used 3+ 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?