Python 3 Basic Programming Test

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Cripstwick
C
Cripstwick
Community Contributor
Quizzes Created: 635 | Total Attempts: 840,647
| Attempts: 958 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. What is the output of print str[0] if str = 'Hello World!'?

Explanation

The correct answer is "H" because when we access the element at index 0 of the string "Hello World!", it returns the first character of the string which is "H".

Submit
Please wait...
About This Quiz
Python 3 Basic Programming Test - Quiz

Python is one of the most popular programming languages in the world today. Python 3.0 was released in the late 2000s as a backwards-incompatible release. If you're just learning Python 3 or want to know how it works, take this basic programming test to assess your knowledge.

2. What is the output of print tuple[0] if tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 )?

Explanation

The correct answer is "abcd" because in Python, tuples are ordered and indexed starting from 0. Therefore, when we access the element at index 0 of the tuple, we get the first element, which is "abcd".

Submit
3. Which of these statements is true for lists and tuples? 

Explanation

Lists and tuples are both types of data structures in Python. The correct statement is that lists are mutable, while tuples are not. This means that elements in a list can be modified, added, or removed after the list is created. On the other hand, elements in a tuple cannot be changed once the tuple is created. Tuples are considered immutable because they provide data integrity and are often used to store related pieces of information that should not be modified.

Submit
4. What is the difference between tuples and lists?

Explanation

Tuples and lists are both used to store multiple items in Python. The main difference between them is that tuples are immutable, meaning their values cannot be changed once they are created, while lists are mutable and can be modified. Tuples are enclosed within parentheses, while lists are not. This difference in syntax allows for easy identification and differentiation between the two data types.

Submit
5. What is the use of // operator in Python?

Explanation

The // operator in Python is used for division. It performs floor division, which means it returns the largest integer that is less than or equal to the result of the division. This is different from the / operator, which returns the exact quotient as a float. The // operator can be useful when you want to divide two numbers and obtain an integer result without any decimal places.

Submit
6. What command can you use to delete a file in Python? 

Explanation

The correct answer is os.remove (filename). This command is used in Python to delete a file. The os module provides various functions for interacting with the operating system, and os.remove() specifically allows you to delete a file by specifying its filename as an argument.

Submit
7. Which of these is not a mutable built-in type Python? 

Explanation

In Python, strings are immutable, which means that once a string is created, it cannot be changed. This is in contrast to lists, sets, and dictionaries, which are mutable and can be modified after creation. Therefore, the correct answer is strings.

Submit
8. Python has how many standard data types?

Explanation

Python has five standard data types. These data types include numbers, strings, lists, tuples, and dictionaries. Each data type has its own characteristics and uses in programming. Numbers are used for mathematical calculations, strings are used for text manipulation, lists are used to store multiple items, tuples are used to store immutable sequences, and dictionaries are used to store key-value pairs. These data types provide flexibility and functionality to Python programmers for various tasks and operations.

Submit
9. What manages memory in Python?

Explanation

Private heap space manages memory in Python. In Python, every object is stored in a private heap, and the interpreter takes care of allocating and deallocating the memory for these objects. The private heap space is where all the objects and data structures are stored during the execution of a Python program. The garbage collector, which is responsible for freeing up memory that is no longer in use, also operates within the private heap space.

Submit
10. What is the process of retrieving original Python objects from the stored string representation?

Explanation

The process of retrieving original Python objects from the stored string representation is called unpicking.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 21, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 29, 2018
    Quiz Created by
    Cripstwick
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What is the output of print str[0] if str = 'Hello World!'?
What is the output of print tuple[0] if tuple = ( 'abcd', 786 , 2.23,...
Which of these statements is true for lists and tuples? 
What is the difference between tuples and lists?
What is the use of // operator in Python?
What command can you use to delete a file in Python? 
Which of these is not a mutable built-in type Python? 
Python has how many standard data types?
What manages memory in Python?
What is the process of retrieving original Python objects from the...
Alert!

Advertisement