Saturday, December 19, 2020

Class-8 Chapter-9 Solved exercise




 

1.

Ans.  +  Operator

2.

Ans. Variables is a quantity, whose value can change as many times as required during the execution of a program.

3.

Ans.  % operator

4.

Ans. (>>>) sign

5.

Ans. Less then (<) or greater then (>)

6.

Ans.  Int : Integers are positive or negative whole numbers with no decimal point

 Float : float represent real numbers and also we can written with a decimal point

7.

Ans. The assigned string should be enclosed in single or double quotes.

8.

Ans.  The float () function converts values received through the input statements into floating point numbers.

 

Short Answer Type Questions.

 

1.

Ans. Python is a popular object oriented programming language that offeres a lot of flexibility.

Features.

a. Easy to Learn and Use

b. Interpreted Language

 

2.

Ans:  Python IDLE (Integrated Development and Learning Environment) is an integrated development environment (IDE) for Python. The Python installer for Windows contains the IDLE module by default.

 

Stpes for create a new program file in IDLE:-

1.      The IDLE shell window opens up. ...

2.      Opening up a new window will create a script file window. ...

3.      You can run the script by going "Run --> Run Module" or simply by hitting F5 (on some systems, Fn + F5).

4.      Before running, IDLE prompts you to save the script as a file.

 

3

Ans. A variable must have a data type associated with it, for example it can have data types like integer, decimal numbers, characters etc. The variable of type Integer stores integer values and a character type variable stores character value. The primary difference between various data types is their size in memory

 

4.

Ans. Python and Java are both programming languages. Python variables are dynamically typed whereas Java variables are statically typed. Java variables are type checked during compile time, unlike Python.

 

5.

Ans. To execute a file in IDLE,

Step -1 In the IDLE shell window, click on the file menu

Step -2 Click on New file option

Step-3 Type your program

Step-4 To save the program with name and extension .py

Step-5  Press F5 for execute the program

The program will execute and the output will be shown in the Shell window.

 

6.

Ans. The if-elif-else statements provide a method to perform multiple tests on a condition.

 

7.

Ans. If else Statement

Syntax :

                        if<condition>:

                        Statement1

                        else:

                        Statement2

8.

Ans. Python provides a Python Shell, which is used to execute a single Python command and display the result.

 

9.

Ans. Right-click the Python window and select Save As to save your code either as a Python file (.py). And give the location on desktop. click on save option. Python code will be saved.

No comments:

Post a Comment