SlideShare a Scribd company logo
1 of 15
codes & notes with every ideas in our study
break & continue :
 Break : its job to go out from
 the actually condition or loop only
 Ex
 x=[0,1,2,3,4,5]
 for i in x :
 print ("*")
 if i == 2:
 break
Output : ***
>>>NOT ******
for ( ) :
If ( ) :
--------
--------
--------
break
-------
-------
-----
break
-----
o Continue : its job to repeat
o the actually condition or loop only
o Ex
o x=[0,1,2,3,4,5]
o for i in x :
o print ("*")
o if i == 2:
o continue
o print("$")
Output : ******
>>> there is no “$”
While
if
______
______
continue
______
______
_____
continue
_____
I. for & while & if >>> should end with ( : )
II. X=X+1 >>>X+=1 && X-1 >>> X=X-1
III. X=Y “take the value in y and put it in x”
IV. X==Y “is the value in x as the same in y ? ”
V. X != Y “ X not equal Y ”
VI. (while True:)testing the code without doing Run every time
VII. When I use many loops ; first I finish the last loop
for (1)
for(2)
for(3)
Third loop
second loop
First loop
 % :: 10%3=1 , 53%10=3 , 115%100=15 “calculate the remainder”
 // :: 11//3=3 , 30//9=3 , 100//40=2 “set the integer num. only”
 To test if the number is negative >>> if x < 0
 To test if the number is odd >>> if x!= 0
 To write a comment >>> #...
 To calculate x power y >>> x**y
x=[1,2,3,4,5,6,7,8,9,10]
for i in x:
print(i)
Output : 12345678910
 So “for loop” start
automaticlly from index[0]
and it additions 1 every time
until the end of the loop
range ( 5 , 100 , 2 )
First num
Last num
Rate of change
x=str(input('enter numbers only :'))
for i in x:
if i=='0' or i=='1'or i=='2'or i=='3'or i=='4'or i=='5'or i=='6'or i=='7'or i=='8'or i=='9':
z=True
else:
z=False
break
print(z)
1)Enter a string which have numbers or letters or twice ,but if and only if this string
includes numbers only: print true , else: print false?
a=[1,2]
b=[]
b=b+a
b=b+a
a.append(3)
print(b)
Output :: [ 1 , 2 , 1 , 2 ]
a=[1,2]
b=[]
c=[4,5,6]
b.append(a)
a.append(c)
a.append(3)
print(b)
Output : [ [ 1 , 2 , [ 4 , 5 , 6 ] , 3 ] ]
 So we can say that python is a dynamic language
which-in case there is no ‘=’operation-have to use all
‘append’ in the code
4]Take from the user a list of numbers then print the maximum and
minimum at last the average of this list ?
Exam Question
for i in range (1,3,1):
for j in range (7,3,-2):
for k in range (1,i,1):
print ('$')
print ('@')
print ('#')
Output:: @@#$@$@#
6]Take from the user 2 numbers and let him choose an operation
between them?
veryyyy imporataaaaaaant
Extra practice sheet 3
http://www.acadox.com/action_handler/download/resource/48372/1287
62.pdf

More Related Content

What's hot

Monads in Ruby - Victor Zagorodny
Monads in Ruby - Victor ZagorodnyMonads in Ruby - Victor Zagorodny
Monads in Ruby - Victor ZagorodnyRuby Meditation
 
C tech questions
C tech questionsC tech questions
C tech questionsvijay00791
 
333 bai tich phan
333 bai tich phan333 bai tich phan
333 bai tich phanndphuc910
 
Kalkulus kelompok 4
Kalkulus kelompok 4Kalkulus kelompok 4
Kalkulus kelompok 4ssuser2eac73
 
Evolving Search Relevancy: Presented by James Strassburg, Direct Supply
Evolving Search Relevancy: Presented by James Strassburg, Direct SupplyEvolving Search Relevancy: Presented by James Strassburg, Direct Supply
Evolving Search Relevancy: Presented by James Strassburg, Direct SupplyLucidworks
 
7 metode-secant
7 metode-secant7 metode-secant
7 metode-secantAlen Pepa
 
Equacao da reta 1 exemplo com todos os quadrantes
Equacao da reta 1   exemplo com todos os quadrantesEquacao da reta 1   exemplo com todos os quadrantes
Equacao da reta 1 exemplo com todos os quadrantesElaine Cecília Gatto
 
USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2vikram mahendra
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語ikdysfm
 
Data Structure - 2nd Study
Data Structure - 2nd StudyData Structure - 2nd Study
Data Structure - 2nd StudyChris Ohk
 
Inequations and finding rule
Inequations and finding ruleInequations and finding rule
Inequations and finding ruleamcsquared
 

What's hot (20)

Monads in Ruby - Victor Zagorodny
Monads in Ruby - Victor ZagorodnyMonads in Ruby - Victor Zagorodny
Monads in Ruby - Victor Zagorodny
 
C tech questions
C tech questionsC tech questions
C tech questions
 
333 bai tich phan
333 bai tich phan333 bai tich phan
333 bai tich phan
 
c programming
c programmingc programming
c programming
 
Langrange method for MATLAB Code
Langrange method for MATLAB CodeLangrange method for MATLAB Code
Langrange method for MATLAB Code
 
Kalkulus kelompok 4
Kalkulus kelompok 4Kalkulus kelompok 4
Kalkulus kelompok 4
 
Newton's method for MATLAB Code
Newton's method for MATLAB CodeNewton's method for MATLAB Code
Newton's method for MATLAB Code
 
Evolving Search Relevancy: Presented by James Strassburg, Direct Supply
Evolving Search Relevancy: Presented by James Strassburg, Direct SupplyEvolving Search Relevancy: Presented by James Strassburg, Direct Supply
Evolving Search Relevancy: Presented by James Strassburg, Direct Supply
 
7 metode-secant
7 metode-secant7 metode-secant
7 metode-secant
 
PostgreSQL Quiz
PostgreSQL QuizPostgreSQL Quiz
PostgreSQL Quiz
 
Equacao da reta 1 exemplo com todos os quadrantes
Equacao da reta 1   exemplo com todos os quadrantesEquacao da reta 1   exemplo com todos os quadrantes
Equacao da reta 1 exemplo com todos os quadrantes
 
USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2
 
CSE240 Pointers
CSE240 PointersCSE240 Pointers
CSE240 Pointers
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語
 
Bb2
Bb2Bb2
Bb2
 
Vcs9
Vcs9Vcs9
Vcs9
 
Data Structure - 2nd Study
Data Structure - 2nd StudyData Structure - 2nd Study
Data Structure - 2nd Study
 
Inequations and finding rule
Inequations and finding ruleInequations and finding rule
Inequations and finding rule
 
DECLARE example
DECLARE exampleDECLARE example
DECLARE example
 
Sql
SqlSql
Sql
 

Similar to Break and continue codes in loops

Python for High School Programmers
Python for High School ProgrammersPython for High School Programmers
Python for High School ProgrammersSiva Arunachalam
 
Pythonlearn-03-Conditional.pptx
Pythonlearn-03-Conditional.pptxPythonlearn-03-Conditional.pptx
Pythonlearn-03-Conditional.pptxVigneshChaturvedi1
 
F# code, code below If i = 1 the branch jumps to line 2, so the pr.pdf
F# code, code below If i = 1 the branch jumps to line 2, so the pr.pdfF# code, code below If i = 1 the branch jumps to line 2, so the pr.pdf
F# code, code below If i = 1 the branch jumps to line 2, so the pr.pdfalphaagenciesindia
 
Python quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung FuPython quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung Fuclimatewarrior
 
Absolute Value Notes
Absolute Value NotesAbsolute Value Notes
Absolute Value Notesmpscils598s07
 
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxerror 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxSALU18
 
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
Task4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docxTask4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docx
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docxjosies1
 
Integers And Order of Operations
Integers And Order of OperationsIntegers And Order of Operations
Integers And Order of Operationsnickromero76
 

Similar to Break and continue codes in loops (20)

Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Python
PythonPython
Python
 
Python for High School Programmers
Python for High School ProgrammersPython for High School Programmers
Python for High School Programmers
 
C++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdfC++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdf
 
Pythonlearn-03-Conditional.pptx
Pythonlearn-03-Conditional.pptxPythonlearn-03-Conditional.pptx
Pythonlearn-03-Conditional.pptx
 
F# code, code below If i = 1 the branch jumps to line 2, so the pr.pdf
F# code, code below If i = 1 the branch jumps to line 2, so the pr.pdfF# code, code below If i = 1 the branch jumps to line 2, so the pr.pdf
F# code, code below If i = 1 the branch jumps to line 2, so the pr.pdf
 
Python.pdf
Python.pdfPython.pdf
Python.pdf
 
Mcq cpup
Mcq cpupMcq cpup
Mcq cpup
 
Basic practice of R
Basic practice of RBasic practice of R
Basic practice of R
 
pointers 1
pointers 1pointers 1
pointers 1
 
Absolute Value
Absolute ValueAbsolute Value
Absolute Value
 
Python quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung FuPython quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung Fu
 
Absolute Value Notes
Absolute Value NotesAbsolute Value Notes
Absolute Value Notes
 
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxerror 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
 
Python Programming
Python Programming Python Programming
Python Programming
 
Python Tidbits
Python TidbitsPython Tidbits
Python Tidbits
 
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
Task4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docxTask4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docx
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
 
Data Handling
Data Handling Data Handling
Data Handling
 
Integers And Order of Operations
Integers And Order of OperationsIntegers And Order of Operations
Integers And Order of Operations
 
Python From Scratch (1).pdf
Python From Scratch  (1).pdfPython From Scratch  (1).pdf
Python From Scratch (1).pdf
 

Recently uploaded

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
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
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
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
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
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
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
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
 

Recently uploaded (20)

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
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
 
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🔝
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
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...
 
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
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
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
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
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
 

Break and continue codes in loops

  • 1. codes & notes with every ideas in our study
  • 2. break & continue :  Break : its job to go out from  the actually condition or loop only  Ex  x=[0,1,2,3,4,5]  for i in x :  print ("*")  if i == 2:  break Output : *** >>>NOT ****** for ( ) : If ( ) : -------- -------- -------- break ------- ------- ----- break -----
  • 3. o Continue : its job to repeat o the actually condition or loop only o Ex o x=[0,1,2,3,4,5] o for i in x : o print ("*") o if i == 2: o continue o print("$") Output : ****** >>> there is no “$” While if ______ ______ continue ______ ______ _____ continue _____
  • 4. I. for & while & if >>> should end with ( : ) II. X=X+1 >>>X+=1 && X-1 >>> X=X-1 III. X=Y “take the value in y and put it in x” IV. X==Y “is the value in x as the same in y ? ” V. X != Y “ X not equal Y ” VI. (while True:)testing the code without doing Run every time VII. When I use many loops ; first I finish the last loop for (1) for(2) for(3) Third loop second loop First loop
  • 5.  % :: 10%3=1 , 53%10=3 , 115%100=15 “calculate the remainder”  // :: 11//3=3 , 30//9=3 , 100//40=2 “set the integer num. only”  To test if the number is negative >>> if x < 0  To test if the number is odd >>> if x!= 0  To write a comment >>> #...  To calculate x power y >>> x**y x=[1,2,3,4,5,6,7,8,9,10] for i in x: print(i) Output : 12345678910  So “for loop” start automaticlly from index[0] and it additions 1 every time until the end of the loop range ( 5 , 100 , 2 ) First num Last num Rate of change
  • 6.
  • 7.
  • 8.
  • 9. x=str(input('enter numbers only :')) for i in x: if i=='0' or i=='1'or i=='2'or i=='3'or i=='4'or i=='5'or i=='6'or i=='7'or i=='8'or i=='9': z=True else: z=False break print(z) 1)Enter a string which have numbers or letters or twice ,but if and only if this string includes numbers only: print true , else: print false?
  • 11. a=[1,2] b=[] c=[4,5,6] b.append(a) a.append(c) a.append(3) print(b) Output : [ [ 1 , 2 , [ 4 , 5 , 6 ] , 3 ] ]  So we can say that python is a dynamic language which-in case there is no ‘=’operation-have to use all ‘append’ in the code
  • 12. 4]Take from the user a list of numbers then print the maximum and minimum at last the average of this list ? Exam Question
  • 13. for i in range (1,3,1): for j in range (7,3,-2): for k in range (1,i,1): print ('$') print ('@') print ('#') Output:: @@#$@$@#
  • 14. 6]Take from the user 2 numbers and let him choose an operation between them?
  • 15. veryyyy imporataaaaaaant Extra practice sheet 3 http://www.acadox.com/action_handler/download/resource/48372/1287 62.pdf