For Quiz Preparation for TGES ,Go to General Knowledge Section

Saturday, October 4

Class -7th Chapter 6( Introduction to Python)

 Chapter 6: Introduction to Python

Checkpoint (Pg. 99)

Fill in the blanks.

1. Guido van Rossum

2. interpreted

3. portable

4. interpreter, compiler

Exercises (Pgs. 113-115)

A. Tick (✓) the correct answers.

1. b

2. b

3. b

4. c

5. b

B. Fill in the blanks.

1. number

2. line by line

3. Script

4. editor

5. assignment

C. Write T for True and F for False.

1. F

2. T

3. F

4. T

5. T

A.    Answer the following questions in short.

Q.1    What is Python? 

Ans:-    Python is a simple programming language used to create games, apps, and websites.

Q.2    What is a variable? 

Ans:-    A variable stores data like numbers or text, which can change during program execution.

Q.3     What is a string? 

Ans:-  A string is a group of characters written inside quotes, like "Hello" . 

Q.4    What is an integer? 

Ans:-    An integer is a whole number without decimals, like 1, 10, or 100.


B.     Answer the following questions in long.

Q.1    What is the role of an interpreter in Python ?

Ans:-  An interpreter reads and executes a program line by line. It translates each statement into machine code as the program runs. This means that when you are writing a program in Python, the interpreter immediately processes each instruction one at a time and executes it. If there is an error in the code, the interpreter stops and shows you where the problem is. This makes it easier to find and fix mistakes as you go along.


Q.2    What are the key difference between Python's interactive mode and script mode ? 

Ans:-     Python has two main modes in which you can write and run your code:

Interactive Mode:- In this mode, Python processes each command or statement as soon as you press the Enter key. It is great for testing small pieces of code and getting immediate results.

Script Mode:- This is used for writing larger programs. A Python script is a collection of commands saved in a file. Once you have written your entire program, you can run it all at once as a single unit.


Q.3    What are the common data types in Python ? 

Ans:-     In Python, you can use the following basic data types:

Numeric Data Types: These types are used to represent numbers. Python supports two main types of numeric data:

• Integer (int): This data type stores whole numbers. The range of integer values is large, from -2,147,483,648 to 2,147,483,647.

Floating-point (float): This data type stores decimal numbers, or numbers with a fractional part.

Boolean (bool): This data type is used to represent logical values. It can hold one of two values: True or False. In Python, 1 represents True and 0 represents False.

String (str): A string is a sequence of characters enclosed in either single quotes (‘) or double quotes (“). Strings are used to represent text.


Q.4    What is the purpose of the print() function in Python ? 

Ans:-     The print( ) function in Python is used to display messages, values, or results of commands on the screen. It is a commonly used function especially when you want to show the output of a program.


Q.5    What is a variable in Python , and how is it used ? 

Ans:- In Python, a variable is a named storage that holds data for use in a program. It acts like a container for values such as numbers or text. Variables are assigned using the = operator, and each can store only one value at a time, which updates when reassigned.


No comments:
Write Comments

Please ask any question about gk related

Total Pageviews

Popular Posts

© 2014 SSC GK.in . Designed by Bloggertheme9 | Distributed By Gooyaabi Templates
Powered by Blogger.