menu

Python Basics

Python Basics - Important Points


1.

What is Python?

A. A high-level programming language

B. A database management system

C. A low-level programming language

D. A markup language

Discuss Work Space

Answer: option a

Explanation:

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.


2.

Which of the following is an advantage of using Python?

A. Easy to learn and use

B. Low-level access to system resources

C. Better performance than other programming languages

D. Limited library support

Discuss Work Space

Answer: option a

Explanation:

One of the key advantages of Python is that it is easy to learn and use.


3.

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

A. 123var

B. _variable

C. class

D. 2_for_1

Discuss Work Space

Answer: option b

Explanation:

Variable names in Python can start with a letter or underscore (), but not a number. They can also include letters, numbers, and underscores.


4.

What is the output of the following code?

print(7 % 3)

A. 2

B. 3

C. 1

D. 7

Discuss Work Space

Answer: option a

Explanation:

The % operator returns the remainder of dividing 7 by 3, which is 1.


5. Which of the following is a valid way to comment a single line of Python code?

A. // This is a comment

B. /* This is a comment */

C. # This is a comment

D. // This is a comment //

Discuss Work Space

Answer: option c

Explanation:

In Python, single-line comments begin with the # character.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now