2) CS11 Unit Ii P2
2) CS11 Unit Ii P2
PYTHON
Topics Covered
Pre-
Assessmen 2)What do you understand by
source code?
t
3)What are language
translators?
Difference between a Program and
Programming Language?
Language translators like compilers and interpreters are needed to translate the source code into
machine language. Python uses an interpreter to convert its instructions into machine language, so that
it can be understood by the computer. An interpreter processes the program statements one by one, first
translating and then executing. This process is continued until an error is encountered or the whole
program is executed successfully. In both the cases, program execution will stop.
On the contrary, a compiler translates the entire source code, as a whole, into the object code. After
scanning the whole program, it generates error messages, if any.
Learning Objective:
2)
3)
4)
Correction
---------------
num=int(input(“Enter any number”))
Correction
---------------
num=int(input(“Enter any number”))
1)Multiline strings can be created in two ways:
a)By adding a backslash at the end of normal
single-quote or double-quote strings,
Example:- Text=“Welcome \
Answer(Ju To\
Python”
st a b)By typing the text in triple quotation marks.(No
minute) backslash needed at the end of the line).
Eg:-Str1=“””Welcome
to
Python”””
• 41.678 – Floating point
• 12345 – Integer
• True – Boolean
• ‘True’ – String
Answer(Ju • “False”- String
st a • OxCAFE – Integer(Hexadecimal)
minute) • 0o456 – Integer(Octal)
• 0o971 – Invalid token(beginning with
0o ,means it is octal number but digits 8 and
9 are invalid digits in octal numbers)
Summary
Can anyone student summarize the important points?
Homework(in notebook)
What is the
What is None literal difference between What is the use of
in Python? an expression and a Comments?
statement in Python?