VKV SirTest Lab

Java and Python Basics: MCQ questions with answers

CS Fundamentals (Placement), Unit 13. 60 Java and Python Basics questions with explanations (CS Fundamentals (Placement)). Topics: Java and Python Basics. Take a free test now.

Topics

Key terms: python, java string, list range, java class, objects, arraylist

Sample questions with answers

  1. To use ArrayList in Java, import:

    Options: A) java.io.*   B) java.util.*   C) java.net.*   D) java.lang.Math

    Answer: B) java.util.*. Collections are in java.util.

  2. A Python dictionary stores:

    Options: A) Only numbers   B) Key–value pairs   C) Ordered duplicates only   D) Functions only

    Answer: B) Key–value pairs. Mapping type.

  3. Python: 3 in [1, 2, 3] gives:

    Options: A) False   B) True   C) 3   D) Error

    Answer: B) True. Membership test.

Take a free Java and Python Basics test

All units of CS Fundamentals (Placement)