0% found this document useful (0 votes)
2 views2 pages

Python_Viva_Questions_Answers_Part1 (2)

The document provides a set of Python interview questions and answers tailored for BCA 1st semester students. It covers fundamental concepts such as the definition of Python, its key features, differences between compilers and interpreters, variable declaration, keywords, data types, typecasting, and the use of comments. The content serves as a study guide for understanding basic Python programming principles.

Uploaded by

tchill580
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Python_Viva_Questions_Answers_Part1 (2)

The document provides a set of Python interview questions and answers tailored for BCA 1st semester students. It covers fundamental concepts such as the definition of Python, its key features, differences between compilers and interpreters, variable declaration, keywords, data types, typecasting, and the use of comments. The content serves as a study guide for understanding basic Python programming principles.

Uploaded by

tchill580
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Python Viva/Interview Questions & Answers (BCA 1st Semester)

1. What is Python?

Python is a high-level, interpreted programming language known for its easy syntax and readability. It

supports multiple programming paradigms, including procedural, object-oriented, and functional

programming.

2. What are the key features of Python?

Key features include:

- Simple and easy to learn

- Interpreted language

- Dynamically typed

- Object-oriented

- Extensive standard libraries

- Open-source

- Portable and platform-independent

3. Explain the difference between a compiler and an interpreter.

A compiler translates the entire source code into machine code at once before execution, while an interpreter

translates and executes code line-by-line. Python uses an interpreter.

4. Is Python a compiled or interpreted language?

Python is an interpreted language, meaning the code is executed line-by-line by the Python interpreter.

5. What are variables in Python? How do you declare them?

Variables are used to store data. In Python, you declare a variable by simply assigning it a value, e.g., x = 10.

6. What are keywords? Name any five keywords in Python.

Keywords are reserved words in Python with special meaning. Examples include: if, else, while, for, def.

7. What are data types in Python?


Python Viva/Interview Questions & Answers (BCA 1st Semester)

Common data types in Python include int, float, str, list, tuple, set, dict, and bool.

8. What is typecasting? How is it done in Python?

Typecasting is converting one data type to another, e.g., int('5') to convert string '5' to integer.

9. What is the difference between input() and raw_input()?

In Python 2, raw_input() reads input as a string, while input() evaluates it. In Python 3, only input() exists and

behaves like raw_input().

10. What are comments in Python? How are they used?

Comments are notes in the code for explanation. Single-line comments start with #. Multi-line comments can

be written using triple quotes (''' or ").

You might also like