SlideShare a Scribd company logo
W W W. L I B W R L D . B L O G S P O T. C O M
PYTHON
REVISION
TOUR - 1
W W W. L I B W R L D . B L O G S P O T. C O M
1 MARK
W W W. L I B W R L D . B L O G S P O T. C O M
Which of the following is valid arithmetic operator in Python:
(i) // (ii)? (iii) < (iv) and
? Is not a symbol used in python
< is used to check conditions
and is used for boolean
// is used for floor division that’s why the correct answer is //
W W W. L I B W R L D . B L O G S P O T. C O M
Identify the valid arithmetic operator in Python from the following.
a) ? b) < c) ** d) and
It is similar to prevous question and yes the answer you chose is correct it’s
c) **
W W W. L I B W R L D . B L O G S P O T. C O M
Find the invalid identifier from the following
a) 2two b) two2 c)trues d) true_sl
2two starts with 2 which is numeric thus it is invalid identifier.
Others don’t violate any law so they are valid identifier
W W W. L I B W R L D . B L O G S P O T. C O M
Find the invalid identifier from the following
a) MyName b) True c) 2ndName d) My_Name
You should have guessed it after reading the question. Yes, the solution is (c) 2ndName
W W W. L I B W R L D . B L O G S P O T. C O M
Evaluate the expression:
if A=16 and B =15 then A//B is
(a) 0.0 (b) 0 (c ) 1.0 (d) 1
(d) 1 is the correct answer because A//B is floor division in which there is no decim
places and 16 is greater than 15.
W W W. L I B W R L D . B L O G S P O T. C O M
Write the modules that will be required to be imported to execute the following
functions in Python
(i) floor( ) (ii) randint( )
Try it……………………………………….Yes you got it right it’s math
W W W. L I B W R L D . B L O G S P O T. C O M
2 MARK
W W W. L I B W R L D . B L O G S P O T. C O M
Evaluate the following expressions:
(i) not(20>6) or (19>7)and(20==20)
(ii) 17%20
(I) The order of preferances is
NOT > AND > OR
so, check the conditions and solve it
(ii) 17%20 gives 17
Since 17 is smaller than 20. It is default setting of python.
W W W. L I B W R L D . B L O G S P O T. C O M
Rewrite the following code in python after removing all syntax error(s).
Underline each correction done in the code.
30=To
for K in range(0,To)
IF k%4==0:
print (K*4)
Else:
print (K+3)
To=30
for K in range(0,To):
if K%4==0:
print(K*4)
else:
print(K+3)
W W W. L I B W R L D . B L O G S P O T. C O M
What do you understand by the term type conversion? Explain with suitable
example.
Typecasting, or type conversion, is a method of changing an entity from one data
type to another. It is used in computer programming to ensure variables are
correctly processed by a function.
An example of typecasting is converting an integer to a string.
A = “17”
B = int(A)
print(b)
It’s output will be 17. Here we converted “17” string into 17 integer value.
W W W. L I B W R L D . B L O G S P O T. C O M
a) Write the names of any two data types available in Python.
b) Name the Python Library modules which need to be imported to invoke the followin
functions :
i) sqrt() ii) randint()
a) String, Integer, Boolean(any two)
b) math
W W W. L I B W R L D . B L O G S P O T. C O M
Evaluate the following expressions:
a) 14+13%15
b) b) 50 > 6 and 3 > 13 or not 19 > 2
a) The preferences for arithmetic operators is
+,- -- %,//,/* ----**
13%15 will give 13 since 13 is greater than 15 and the sum will be 27
b) It’s solution will be FALSE. Check previous questions for referance.
W W W. L I B W R L D . B L O G S P O T. C O M
Evaluate the following expressions:
a) 6 * 3 + 4**2 // 5 – 8
b) b) 10 > 5 and 7 > 12 or not 18 > 3
a) The steps taken will be in order:
4**2 which will give 16
6*3 which will give 18
16//5 which will give 3
3-8 which will give -5
18+(-5) which will give 13
So the solution is 13.
b) Do it yourself. The solution is FALSE.
W W W. L I B W R L D . B L O G S P O T. C O M
Rewrite the following code in Python after removing all syntax error(s).
Underline each correction done in the code.
V=80
for c in range(0,V)
If c%4=0:
print (c*4)
Elseif c%5==0:
print (c+3)
else:
print(c+10)
V=80
for c in range(0,V) :
if c%4==0:
print (c*4)
elif c%5==0:
print (c+3)
else:
print(c+10)
W W W. L I B W R L D . B L O G S P O T. C O M
Rewrite the following code in Python after removing all syntax error(s).
Underline each correction done in the code.
Value=30
for VAL in range(0,Value)
If val%4==0:
print (VAL*4)
Elseif val%5==0:
print (VAL+3)
else
print(VAL+10)
Try debugging(removing all errors) yourself. It is important to practice..
W W W. L I B W R L D . B L O G S P O T. C O M
Evaluate the following expressions:
a) 5 * 3 + 3**2 % 5 – 8
b) b) 8>5 or 10 > 12 and not 18 > 3
Solve it yourself and comment below to show your participation.
W W W. L I B W R L D . B L O G S P O T. C O M
Rewrite the following code in Python after removing all syntax error(s).
Underline each correction done in the code.
Num=int(“Enter a number”)
for N in range(0,Num)
If n%2=0:
print (n*4)
Elseif n%5==0:
Print (n+3)
else
print(n+10)
Do it yourself and Comment the solution below.
W W W. L I B W R L D . B L O G S P O T. C O M
Rewrite the following code in Python after removing all syntax error(s). Underline
each correction done in the code.
250 = Number
WHILE Number<=1000:
If Number=>750:
print(Number)
Number=Number+100
else
print(Number*2)
Number=Number+50
It is an easy question. I know that after doing the previous questions it must feel
Boring but let’s do it. Comment below your hardwork.

More Related Content

PDF
Assignment
PPTX
Basic Block
DOC
Ques c++ minhnd
PPTX
COMPILER DESIGN AND CONSTRUCTION
PDF
Assignment12
PPT
Toc CFG cfl properties
PDF
[Question Paper] Introduction To C++ Programming (Revised Course) [April / 2015]
PPT
Lecture 2
Assignment
Basic Block
Ques c++ minhnd
COMPILER DESIGN AND CONSTRUCTION
Assignment12
Toc CFG cfl properties
[Question Paper] Introduction To C++ Programming (Revised Course) [April / 2015]
Lecture 2

What's hot (20)

PDF
Bc0052 theory of computer science-mqp
PDF
Exam1 (example with solutions)
PDF
Assignment6
PDF
C++17 not your father’s c++
PDF
Choosing gates, Schematic Diagrams and Logic Gates Code
PPT
6 operators-in-c
PPTX
Intermediate code
PPT
03 Operators and expressions
PDF
Using either foldLeft or foldRight to concatenate the elements of list[T] usi...
PDF
C Programming Interview Questions
PPT
Top down parsing
PDF
Digital Logic & Design
PDF
[Question Paper] Introduction To C++ Programming (Revised Course) [May / 2016]
PPT
Lecture 03 lexical analysis
PPTX
Three address code generation
PDF
Applications of Stack
PDF
Python for Scientific Computing
PPTX
Error correction-and-type-of-error-in-c
Bc0052 theory of computer science-mqp
Exam1 (example with solutions)
Assignment6
C++17 not your father’s c++
Choosing gates, Schematic Diagrams and Logic Gates Code
6 operators-in-c
Intermediate code
03 Operators and expressions
Using either foldLeft or foldRight to concatenate the elements of list[T] usi...
C Programming Interview Questions
Top down parsing
Digital Logic & Design
[Question Paper] Introduction To C++ Programming (Revised Course) [May / 2016]
Lecture 03 lexical analysis
Three address code generation
Applications of Stack
Python for Scientific Computing
Error correction-and-type-of-error-in-c
Ad

Similar to PYTHON REVISION TOUR - 1 (20)

DOCX
(Www.entrance exam.net)-tcs placement sample paper 2
PDF
‘How to develop Pythonic coding rather than Python coding – Logic Perspective’
DOCX
Technical questions
PDF
(2 - 1) CSE1021 - Module 2 Worksheet.pdf
PPTX
Technical aptitude test 2 CSE
PDF
Computer science sqp
DOCX
ExamName___________________________________MULTIPLE CH.docx
DOCX
Functions Practice Sheet.docx
PDF
important C questions and_answers praveensomesh
PDF
C++ in 10 Hours.pdf.pdf
PDF
MATLAB Questions and Answers.pdf
DOCX
Qust & ans inc
PPS
C programming session 02
PPTX
Dti2143 chapter 3 arithmatic relation-logicalexpression
PDF
guia de referencia para a linguagem do fabricante CCS info_syntax.pdf
PDF
C multiple choice questions and answers pdf
PPTX
2.overview of c#
PDF
Python For Machine Learning
PPT
Introduction to C++
PDF
C Language MCQ Programming Theory Questions
(Www.entrance exam.net)-tcs placement sample paper 2
‘How to develop Pythonic coding rather than Python coding – Logic Perspective’
Technical questions
(2 - 1) CSE1021 - Module 2 Worksheet.pdf
Technical aptitude test 2 CSE
Computer science sqp
ExamName___________________________________MULTIPLE CH.docx
Functions Practice Sheet.docx
important C questions and_answers praveensomesh
C++ in 10 Hours.pdf.pdf
MATLAB Questions and Answers.pdf
Qust & ans inc
C programming session 02
Dti2143 chapter 3 arithmatic relation-logicalexpression
guia de referencia para a linguagem do fabricante CCS info_syntax.pdf
C multiple choice questions and answers pdf
2.overview of c#
Python For Machine Learning
Introduction to C++
C Language MCQ Programming Theory Questions
Ad

Recently uploaded (20)

PDF
Business Ethics Teaching Materials for college
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
01-Introduction-to-Information-Management.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Institutional Correction lecture only . . .
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
master seminar digital applications in india
PDF
RMMM.pdf make it easy to upload and study
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
Business Ethics Teaching Materials for college
human mycosis Human fungal infections are called human mycosis..pptx
Anesthesia in Laparoscopic Surgery in India
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPH.pptx obstetrics and gynecology in nursing
Renaissance Architecture: A Journey from Faith to Humanism
01-Introduction-to-Information-Management.pdf
VCE English Exam - Section C Student Revision Booklet
Institutional Correction lecture only . . .
Abdominal Access Techniques with Prof. Dr. R K Mishra
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
Microbial disease of the cardiovascular and lymphatic systems
Supply Chain Operations Speaking Notes -ICLT Program
O7-L3 Supply Chain Operations - ICLT Program
master seminar digital applications in india
RMMM.pdf make it easy to upload and study
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Week 4 Term 3 Study Techniques revisited.pptx

PYTHON REVISION TOUR - 1

  • 1. W W W. L I B W R L D . B L O G S P O T. C O M PYTHON REVISION TOUR - 1
  • 2. W W W. L I B W R L D . B L O G S P O T. C O M 1 MARK
  • 3. W W W. L I B W R L D . B L O G S P O T. C O M Which of the following is valid arithmetic operator in Python: (i) // (ii)? (iii) < (iv) and ? Is not a symbol used in python < is used to check conditions and is used for boolean // is used for floor division that’s why the correct answer is //
  • 4. W W W. L I B W R L D . B L O G S P O T. C O M Identify the valid arithmetic operator in Python from the following. a) ? b) < c) ** d) and It is similar to prevous question and yes the answer you chose is correct it’s c) **
  • 5. W W W. L I B W R L D . B L O G S P O T. C O M Find the invalid identifier from the following a) 2two b) two2 c)trues d) true_sl 2two starts with 2 which is numeric thus it is invalid identifier. Others don’t violate any law so they are valid identifier
  • 6. W W W. L I B W R L D . B L O G S P O T. C O M Find the invalid identifier from the following a) MyName b) True c) 2ndName d) My_Name You should have guessed it after reading the question. Yes, the solution is (c) 2ndName
  • 7. W W W. L I B W R L D . B L O G S P O T. C O M Evaluate the expression: if A=16 and B =15 then A//B is (a) 0.0 (b) 0 (c ) 1.0 (d) 1 (d) 1 is the correct answer because A//B is floor division in which there is no decim places and 16 is greater than 15.
  • 8. W W W. L I B W R L D . B L O G S P O T. C O M Write the modules that will be required to be imported to execute the following functions in Python (i) floor( ) (ii) randint( ) Try it……………………………………….Yes you got it right it’s math
  • 9. W W W. L I B W R L D . B L O G S P O T. C O M 2 MARK
  • 10. W W W. L I B W R L D . B L O G S P O T. C O M Evaluate the following expressions: (i) not(20>6) or (19>7)and(20==20) (ii) 17%20 (I) The order of preferances is NOT > AND > OR so, check the conditions and solve it (ii) 17%20 gives 17 Since 17 is smaller than 20. It is default setting of python.
  • 11. W W W. L I B W R L D . B L O G S P O T. C O M Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code. 30=To for K in range(0,To) IF k%4==0: print (K*4) Else: print (K+3) To=30 for K in range(0,To): if K%4==0: print(K*4) else: print(K+3)
  • 12. W W W. L I B W R L D . B L O G S P O T. C O M What do you understand by the term type conversion? Explain with suitable example. Typecasting, or type conversion, is a method of changing an entity from one data type to another. It is used in computer programming to ensure variables are correctly processed by a function. An example of typecasting is converting an integer to a string. A = “17” B = int(A) print(b) It’s output will be 17. Here we converted “17” string into 17 integer value.
  • 13. W W W. L I B W R L D . B L O G S P O T. C O M a) Write the names of any two data types available in Python. b) Name the Python Library modules which need to be imported to invoke the followin functions : i) sqrt() ii) randint() a) String, Integer, Boolean(any two) b) math
  • 14. W W W. L I B W R L D . B L O G S P O T. C O M Evaluate the following expressions: a) 14+13%15 b) b) 50 > 6 and 3 > 13 or not 19 > 2 a) The preferences for arithmetic operators is +,- -- %,//,/* ----** 13%15 will give 13 since 13 is greater than 15 and the sum will be 27 b) It’s solution will be FALSE. Check previous questions for referance.
  • 15. W W W. L I B W R L D . B L O G S P O T. C O M Evaluate the following expressions: a) 6 * 3 + 4**2 // 5 – 8 b) b) 10 > 5 and 7 > 12 or not 18 > 3 a) The steps taken will be in order: 4**2 which will give 16 6*3 which will give 18 16//5 which will give 3 3-8 which will give -5 18+(-5) which will give 13 So the solution is 13. b) Do it yourself. The solution is FALSE.
  • 16. W W W. L I B W R L D . B L O G S P O T. C O M Rewrite the following code in Python after removing all syntax error(s). Underline each correction done in the code. V=80 for c in range(0,V) If c%4=0: print (c*4) Elseif c%5==0: print (c+3) else: print(c+10) V=80 for c in range(0,V) : if c%4==0: print (c*4) elif c%5==0: print (c+3) else: print(c+10)
  • 17. W W W. L I B W R L D . B L O G S P O T. C O M Rewrite the following code in Python after removing all syntax error(s). Underline each correction done in the code. Value=30 for VAL in range(0,Value) If val%4==0: print (VAL*4) Elseif val%5==0: print (VAL+3) else print(VAL+10) Try debugging(removing all errors) yourself. It is important to practice..
  • 18. W W W. L I B W R L D . B L O G S P O T. C O M Evaluate the following expressions: a) 5 * 3 + 3**2 % 5 – 8 b) b) 8>5 or 10 > 12 and not 18 > 3 Solve it yourself and comment below to show your participation.
  • 19. W W W. L I B W R L D . B L O G S P O T. C O M Rewrite the following code in Python after removing all syntax error(s). Underline each correction done in the code. Num=int(“Enter a number”) for N in range(0,Num) If n%2=0: print (n*4) Elseif n%5==0: Print (n+3) else print(n+10) Do it yourself and Comment the solution below.
  • 20. W W W. L I B W R L D . B L O G S P O T. C O M Rewrite the following code in Python after removing all syntax error(s). Underline each correction done in the code. 250 = Number WHILE Number<=1000: If Number=>750: print(Number) Number=Number+100 else print(Number*2) Number=Number+50 It is an easy question. I know that after doing the previous questions it must feel Boring but let’s do it. Comment below your hardwork.