Grade 6
Subject: Computers
Introduction to Python
______________________________________________________________________________
1. Write any three features of Python.
A.
1. Easy-to-code
2. Open-source language
3. Interpreted language
----------------------------------------------------------------------------------------
2. What is a prompt in Python IDLE?
A. You will see a blinking cursor after the symbol (>>>), which
indicates the python interpreter is ready to accept commands. The
prompt allows the user to enter commands directly into python and
get an output instantly by pressing the Enter key.
----------------------------------------------------------------------------------------
3. Write an example of declaring and intitialising a variable.
A. In python, variables are declared and initialized at the same time
in the following way:
Example:
a=10
b=20
4. State any two variable naming conventions.
A.
1. A variable name must start with a letter (a-z, A-Z), or an
underscore (_).
2. A variable name cannot start with digits (0-9)
----------------------------------------------------------------------------------------
5. Explain the components of Python window.
A. There are two components of Python IDLE window.
1. Menu bar: The menu bar of Python IDLE window is similar to the
menu bar of the other programs. It has various menus such as File,
Edit, Shell, Debug, Options, Window and Help.
2. Prompt: You will see a blinking cursor after the symbol (>>>),
which indicates the python interpreter is ready to accept commands.
The prompt allows the user to enter commands directly into python
and get an output instantly by pressing the Enter key.
----------------------------------------------------------------------------------------
6. Differentiate among the input ( ) and print ( ) functions.
A.
1. input ( ): The input ( ) function is used to take input from the user
during the execution of a program.
Syntax: input ( [<prompt>] )
Example: name=input (“Enter your name :”)
>>> Enter your name: Computers
2. print ( ): The print ( ) function prints or send the output to the
standard output device, which is usually a monitor. This function
automatically converts the items into strings.
Syntax: print([ statements])
Example: print(“Hello Grade 6 students”)
>>> Hello Grade 6 students