SlideShare a Scribd company logo
1 of 20
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

What's hot

Bc0052 theory of computer science-mqp
Bc0052 theory of computer science-mqpBc0052 theory of computer science-mqp
Bc0052 theory of computer science-mqpSuhas Jogale
 
C++17 not your father’s c++
C++17  not your father’s c++C++17  not your father’s c++
C++17 not your father’s c++Patrick Viafore
 
Choosing gates, Schematic Diagrams and Logic Gates Code
Choosing gates, Schematic Diagrams and Logic Gates CodeChoosing gates, Schematic Diagrams and Logic Gates Code
Choosing gates, Schematic Diagrams and Logic Gates Codeinventionjournals
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressionsmaznabili
 
Using either foldLeft or foldRight to concatenate the elements of list[T] usi...
Using either foldLeft or foldRight to concatenate the elements of list[T] usi...Using either foldLeft or foldRight to concatenate the elements of list[T] usi...
Using either foldLeft or foldRight to concatenate the elements of list[T] usi...Philip Schwarz
 
C Programming Interview Questions
C Programming Interview QuestionsC Programming Interview Questions
C Programming Interview QuestionsGradeup
 
Digital Logic & Design
Digital Logic & DesignDigital Logic & Design
Digital Logic & DesignShefa Idrees
 
[Question Paper] Introduction To C++ Programming (Revised Course) [May / 2016]
[Question Paper] Introduction To C++ Programming (Revised Course) [May / 2016][Question Paper] Introduction To C++ Programming (Revised Course) [May / 2016]
[Question Paper] Introduction To C++ Programming (Revised Course) [May / 2016]Mumbai B.Sc.IT Study
 
Lecture 03 lexical analysis
Lecture 03 lexical analysisLecture 03 lexical analysis
Lecture 03 lexical analysisIffat Anjum
 
Three address code generation
Three address code generationThree address code generation
Three address code generationRabin BK
 
Python for Scientific Computing
Python for Scientific ComputingPython for Scientific Computing
Python for Scientific ComputingAlbert DeFusco
 
Error correction-and-type-of-error-in-c
Error correction-and-type-of-error-in-cError correction-and-type-of-error-in-c
Error correction-and-type-of-error-in-cMd Nazmul Hossain Mir
 

What's hot (20)

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

Similar to PYTHON REVISION TOUR - 1

(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2Pamidimukkala Sivani
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSESujata Regoti
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxgitagrimston
 
Functions Practice Sheet.docx
Functions Practice Sheet.docxFunctions Practice Sheet.docx
Functions Practice Sheet.docxSwatiMishra364461
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomeshpraveensomesh
 
MATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfMATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfahmed8651
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
C programming session 02
C programming session 02C programming session 02
C programming session 02Dushmanta Nath
 
Dti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpressionDti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpressionalish sha
 
guia de referencia para a linguagem do fabricante CCS info_syntax.pdf
guia de referencia para a linguagem do fabricante CCS info_syntax.pdfguia de referencia para a linguagem do fabricante CCS info_syntax.pdf
guia de referencia para a linguagem do fabricante CCS info_syntax.pdfSilvanildoManoeldaSi
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdfchoconyeuquy
 
2.overview of c#
2.overview of c#2.overview of c#
2.overview of c#Raghu nath
 
Python For Machine Learning
Python For Machine LearningPython For Machine Learning
Python For Machine LearningYounesCharfaoui
 
Introduction to C++
Introduction to C++ Introduction to C++
Introduction to C++ Bharat Kalia
 
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdfLDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdfVedant Gavhane
 
Technical aptitude Test 1 CSE
Technical aptitude Test 1 CSETechnical aptitude Test 1 CSE
Technical aptitude Test 1 CSESujata Regoti
 

Similar to PYTHON REVISION TOUR - 1 (20)

(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2
 
Technical questions
Technical questionsTechnical questions
Technical questions
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSE
 
Computer science sqp
Computer science sqpComputer science sqp
Computer science sqp
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
 
Functions Practice Sheet.docx
Functions Practice Sheet.docxFunctions Practice Sheet.docx
Functions Practice Sheet.docx
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
 
C++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdfC++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdf
 
MATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfMATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdf
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
 
Dti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpressionDti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpression
 
guia de referencia para a linguagem do fabricante CCS info_syntax.pdf
guia de referencia para a linguagem do fabricante CCS info_syntax.pdfguia de referencia para a linguagem do fabricante CCS info_syntax.pdf
guia de referencia para a linguagem do fabricante CCS info_syntax.pdf
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdf
 
2.overview of c#
2.overview of c#2.overview of c#
2.overview of c#
 
Python For Machine Learning
Python For Machine LearningPython For Machine Learning
Python For Machine Learning
 
Introduction to C++
Introduction to C++ Introduction to C++
Introduction to C++
 
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdfLDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
 
MODULE. .pptx
MODULE.                              .pptxMODULE.                              .pptx
MODULE. .pptx
 
Technical aptitude Test 1 CSE
Technical aptitude Test 1 CSETechnical aptitude Test 1 CSE
Technical aptitude Test 1 CSE
 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Recently uploaded (20)

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

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.