Introduction To Python9876543210
Introduction To Python9876543210
Introduction to Python
Q 3: What is IDLE?
Ans: 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.IDLE is not available by default in Python distributions for Linux.
IDLE can be used to execute a single statement just like Python Shell and also to create,
modify, and execute Python scripts. IDLE provides a fully-featured text editor to create
Python script that includes features like syntax highlighting, autocompletion, and smart
indent. It also has a debugger with stepping and breakpoints features.
Identifiers in Python are words that we use to specify or declare variables. An identifier is
any word that we employ as a variable name. It is vital to remember that the identifiers are
case sensitive. (pg-286)
Q 9: Create a Python list containing elements ‘I’, ‘am’, ‘the’, ‘best’ but print only the last
two elements.
Ans: List1=[‘I’,’am’,’the’,’best’]
Last_two_element=List1[-2:] #Slice the last two elements
Print( Last_two_element)
Q 10: Explain the functioning of the while loop in Python programming with the help of a
flowchart.
Ans: Python While Loop is used to execute a block of statements repeatedly until a given
condition is satisfied. And when the condition becomes false, the line immediately after
the loop in the program is executed.
Syntax:
while condition:
statements(code)
(pg-300)