0% found this document useful (0 votes)
64 views9 pages

Python Basics for Beginners

class 8

Uploaded by

sweetyappu88
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)
64 views9 pages

Python Basics for Beginners

class 8

Uploaded by

sweetyappu88
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/ 9

Chapter-1

Introduction to Python

Fill in the blanks:-

1. A computer program is a collection of _instructions__ that can be executed by a computer to perform a


specific task.
2. Python was created by _Guido Van Rossum_ in 1991.
3. Python is based on two programming languages: _ABC_ and _Modula 3_.
4. Python is a _platform-independent_ language, which means it can run on various operating systems and
hardware platforms.
5. Python uses _indentation_ to create blocks of code.
6. _IDLE_ stands for Integrated Development Learning Environment.
7. In Script mode, files in Python are saved with the extension _.py_.
8. To run a Python program in Script mode, click on the _Run_ menu and choose Run Module or press the
_F5_ key.
9. To quit the Python prompt, you can type _exit()_.
10. Python programs are executed by an _interpreter_.
11. One of the applications of Python is _web development__.
12. Python is an example of a _high_ level programming language.
13. The Python installation process ends with the __Finish__ button.
14. Python IDLE can be started by typing _IDLE_ in the search bar.
15. In Python, _MARKS_ and marks are considered different due to case sensitivity.
16. Python is an __open__ source language.
17. To change the font size in Python IDLE, select the __Options__ menu.
18. Python's _script__ mode allows saving commands for future use.
19. Python uses indentation instead of __brackets__ for blocks of code.
20. To configure Python IDLE, go to the __Options__ menu.

Multiple Choice Questions:-

1. Python is a:

a) High-level language

b) Low-level language

c) Assembly language

d) Machine language

2. Python is:

a) A paid language

b) A free and open-source language

c) An outdated language

d) Only for web development

3. Python programs are executed by:


a) Compiler

b) Interpreter

c) Assembler

d) Loader

4. Python syntax uses:

a) Semicolons to complete commands

b) Parentheses to complete commands

c) Curly brackets to complete commands

d) New lines to complete commands

5. Python uses __________ to define blocks of code.

a) Curly brackets

b) Indentation

c) Parentheses

d) Semicolons

6. In Python, the extension for a script file is:

a) .txt

b) .py

c) .java

d) .cpp

7. Which of the following is true about Python?

a) Python is case-sensitive.

b) Python is case-insensitive.

c) Python does not support case sensitivity.

d) Python only supports uppercase syntax.

8. Python can run on:

a) Only Windows

b) Only Mac OS

c) Only Linux

d) Various operating systems and hardware platforms


9. Which key is used to run a Python program in Script mode?

a) F2

b) F4

c) F5

d) F8

10. Python is often used for:

a) Web Development

b) Game Development

c) Data Analytics

d) All of the above

11. To customize Python IDLE, you go to:

a) File -> Configure IDLE

b) Edit -> Configure IDLE

c) Options -> Configure IDLE

d) View -> Configure IDLE

12. Which of the following is a popular application of Python?

a) Microsoft Word

b) Instagram

c) Linux OS

d) Android Studio

Source Based Questions:-

1. Python Origins Python, a widely used programming language, was developed by Guido Van Rossum in
1991. It draws its inspiration from ABC language and Modula-3, incorporating their best features into its
design. Since its inception, Python has gained immense popularity and has become a cornerstone of
modern software development.

Who created Python?

a) James Gosling

b) Bjarne Stroustrup

c) Guido Van Rossum

d) Dennis Ritchie
2. Python’s Nature Python stands out as a high-level language that is not only powerful but also free and
open-source. Its accessibility and community-driven development have contributed to its widespread
adoption.

Python is a:

a) High-level language

b) Low-level language

c) Assembly language

d) Machine language

3. Python’s Distribution Python’s distribution model emphasizes accessibility and inclusivity, offering a free
and open-source platform for developers worldwide. This democratization of programming languages has
empowered countless individuals and organizations to harness the power of Python for their projects.

Python is:

a) A paid language

b) A free and open-source language

c) An outdated language

d) Only for web development

4. Python Execution Python programs are executed by an interpreter, which interprets the code line by line
and executes it in real-time. This dynamic execution model enables developers to test and debug their
code efficiently.

Python programs are executed by:

a) Compiler

b) Interpreter

c) Assembler

d) Loader

5. Code Blocks In Python, code blocks are defined by indentation, rather than traditional curly brackets or
keywords. This indentation-based approach promotes code clarity and readability, enhancing the overall
development experience.

Python uses __________ to define blocks of code.

a) Curly brackets

b) Indentation

c) Parentheses

d) Semicolons
6. Script Files Python script files are identified by the .py extension, indicating that they contain Python
code. These script files can be executed directly or imported into other Python programs for modular
development.

In Python, the extension for a script file is:

a) .txt

b) .py

c) .java

d) .cpp

7. Case Sensitivity Python is a case-sensitive language, meaning that variable names and identifiers are
distinguished by their case. This sensitivity to case ensures precision and accuracy in code execution.

Which of the following is true about Python?

a) Python is case-sensitive.

b) Python is case-insensitive.

c) Python does not support case sensitivity.

d) Python only supports uppercase syntax.

8. IDLE Customization Python IDLE (Integrated Development Learning Environment) offers customization
options to tailor the user experience. Users can adjust settings such as font size, color scheme, and
language preferences to suit their needs and preferences.

To change the font size in Python IDLE, you need to go to:

a) File menu

b) Edit menu

c) Options menu

d) View menu

Assertion-Reasoning Questions:-

1. Assertion: Python is an object-oriented programming language.

Reason: It supports the creation and manipulation of objects, encapsulation, and inheritance.

Options:

a) Both assertion and reason are true, and the reason is the correct explanation of the assertion.

b) Both assertion and reason are true, but the reason is not the correct explanation of the assertion.

c) Assertion is true, but the reason is false.

d) Assertion is false, but the reason is true.


2. Assertion: Python is an interpreted language.

Reason: Python code is executed line by line by the Python interpreter without the need for compilation.

Options:

a) Both assertion and reason are true, and the reason is the correct explanation of the assertion.

b) Both assertion and reason are true, but the reason is not the correct explanation of the assertion.

c) Assertion is true, but the reason is false.

d) Assertion is false, but the reason is true.

3. Assertion: Python is platform-independent.

Reason: Python programs can run on various operating systems without modification.

Options:

a) Both assertion and reason are true, and the reason is the correct explanation of the assertion.

b) Both assertion and reason are true, but the reason is not the correct explanation of the assertion.

c) Assertion is true, but the reason is false.

d) Assertion is false, but the reason is true.

4. Assertion: Python uses indentation to define code blocks.

Reason: Indentation enhances code readability and structure in Python.

Options:

a) Both assertion and reason are true, and the reason is the correct explanation of the assertion.

b) Both assertion and reason are true, but the reason is not the correct explanation of the assertion.

c) Assertion is true, but the reason is false.

d) Assertion is false, but the reason is true.

5. Assertion: Python's syntax is easy to learn and understand.

Reason: Python uses English-like syntax and has clear and concise syntax rules.

Options:

a) Both assertion and reason are true, and the reason is the correct explanation of the assertion.

b) Both assertion and reason are true, but the reason is not the correct explanation of the assertion.

c) Assertion is true, but the reason is false.

d) Assertion is false, but the reason is true.


7. Assertion: Python has a rich library of predefined functions and modules.

Reason: Python's standard library provides a wide range of modules and functions for various tasks such as file
I/O, networking, and data manipulation.

Options:

a) Both assertion and reason are true, and the reason is the correct explanation of the assertion.

b) Both assertion and reason are true, but the reason is not the correct explanation of the assertion.

c) Assertion is true, but the reason is false.

d) Assertion is false, but the reason is true.

8 Assertion: Python is case-sensitive.

Reason: In Python, variable names and identifiers are distinguished by their case.

Options:

a) Both assertion and reason are true, and the reason is the correct explanation of the assertion.

b) Both assertion and reason are true, but the reason is not the correct explanation of the assertion.

c) Assertion is true, but the reason is false.

d) Assertion is false, but the reason is true.

9 Assertion: Python is free and open-source.

Reason: Python can be freely distributed, modified, and used for both commercial and non-commercial purposes.

Options:

a) Both assertion and reason are true, and the reason is the correct explanation of the assertion.

b) Both assertion and reason are true, but the reason is not the correct explanation of the assertion.

c) Assertion is true, but the reason is false.

d) Assertion is false, but the reason is true.

10. Assertion: Python is widely used in web development.

Reason: Python frameworks like Django and Flask are popular choices for building web applications.

Options:

a) Both assertion and reason are true, and the reason is the correct explanation of the assertion.

b) Both assertion and reason are true, but the reason is not the correct explanation of the assertion.

c) Assertion is true, but the reason is false.

d) Assertion is false, but the reason is true.

11) Assertion: Python is used for data analytics.


Reason: Python provides libraries like Pandas and NumPy for data manipulation, analysis, and visualization.

Options:

a) Both assertion and reason are true, and the reason is the correct explanation of the assertion.

b) Both assertion and reason are true, but the reason is not the correct explanation of the assertion.

c) Assertion is true, but the reason is false.

d) Assertion is false, but the reason is true.

12) Assertion: Python is an easy language for beginners to learn.

Reason: Python's clear and concise syntax makes it accessible to beginners with little programming experience.

Options:

a) Both assertion and reason are true, and the reason is the correct explanation of the assertion.

b) Both assertion and reason are true, but the reason is not the correct explanation of the assertion.

c) Assertion is true, but the reason is false.

d) Assertion is false, but the reason is true.

F. Short Answer Type Questions (20-30 words)

1. What is a computer program?

2. Who created Python and in which year?

3. Name two programming languages that influenced Python.

4. What is the full form of IDLE in Python?

5. How does Python handle case sensitivity?

6. Mention two operating systems where Python can run.

7. What are two features of Python that make it easy to understand?

8. How does Python's syntax compare to English?

9. What symbol does Python use to complete a command?

10. What does Python use to create blocks of code?

11. Name any two applications developed using Python.

12. What type of language is Python?

13. What is an interpreted language?

14. Give an example of a high-level language other than Python.

15. How do you start Python IDLE?


G. Long Answer Type Questions (50-60 words)

1. Explain the role of a computer programmer.

2. Describe the history of Python's creation.

3. What are the main features of the ABC language and Modula-3 that influenced Python?

4. What makes Python a popular programming language today?

5. How does Python's high-level nature benefit programmers?

6. Describe the process of downloading and installing Python.

7. How do you configure the Python IDLE to change the font size?

8. Compare the usage of new lines in Python with semicolons in other languages.

9. Explain how indentation is used in Python to create blocks of code.

10. What are the steps to start Python IDLE and open a new file?

You might also like