SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
Example 9: Program uses the method isdigit to guard against improper input. It Request two
numbers and tind their sum. Validate the impuk. num1 = 1nput ("Enter f1rst number: ") num2 =
input ("Enter second number: ") In Display sum if entrien are valid. Otherrise, 1 intorn f the user
where invalid antries were made. if nun1, 1sdigit () and num2,1sdigit () : print ("The sum 1s", str
(eval (num1) +eval(nun2))+.7) el1e not num1.1sdigit() : if not num 2,1adig1t() : print("Neither
entry was a proper number.") else:
Example 9: Program uses the method isdigit to guard against improper input. else: print("The
rirst entry was not a proper number.") print("The second entry was not a proper number.") [Run]
Znter flrat number: 5 Enter socond number: 51x the second entry was not a proper number.

Más contenido relacionado

Más de info794682

Find the present worth of the following cash flow diagram at i=8 per.pdf
 Find the present worth of the following cash flow diagram at i=8 per.pdf Find the present worth of the following cash flow diagram at i=8 per.pdf
Find the present worth of the following cash flow diagram at i=8 per.pdfinfo794682
 
Exhibit 2.7 Refer to Exhibit 2-7. For which of the following is the a.pdf
 Exhibit 2.7 Refer to Exhibit 2-7. For which of the following is the a.pdf Exhibit 2.7 Refer to Exhibit 2-7. For which of the following is the a.pdf
Exhibit 2.7 Refer to Exhibit 2-7. For which of the following is the a.pdfinfo794682
 
Find the Pumalue for the indicated hypodhesis sest whithe given stand.pdf
 Find the Pumalue for the indicated hypodhesis sest whithe given stand.pdf Find the Pumalue for the indicated hypodhesis sest whithe given stand.pdf
Find the Pumalue for the indicated hypodhesis sest whithe given stand.pdfinfo794682
 
Find the indicated z score. The graph depicts the standard normal.pdf
 Find the indicated z score. The graph depicts the standard normal.pdf Find the indicated z score. The graph depicts the standard normal.pdf
Find the indicated z score. The graph depicts the standard normal.pdfinfo794682
 
Find the following values by using the Poisson formula. Appendix A St.pdf
 Find the following values by using the Poisson formula. Appendix A St.pdf Find the following values by using the Poisson formula. Appendix A St.pdf
Find the following values by using the Poisson formula. Appendix A St.pdfinfo794682
 
Find the area of the shaded region. The graph to the right depicts 1Q.pdf
 Find the area of the shaded region. The graph to the right depicts 1Q.pdf Find the area of the shaded region. The graph to the right depicts 1Q.pdf
Find the area of the shaded region. The graph to the right depicts 1Q.pdfinfo794682
 
Find the following values by using the Poisson formula. (Round in.pdf
 Find the following values by using the Poisson formula. (Round in.pdf Find the following values by using the Poisson formula. (Round in.pdf
Find the following values by using the Poisson formula. (Round in.pdfinfo794682
 
Find the area of the shaded region. The graph to the right .pdf
 Find the area of the shaded region. The graph to the right .pdf Find the area of the shaded region. The graph to the right .pdf
Find the area of the shaded region. The graph to the right .pdfinfo794682
 
Find the area of the shaded region. The graph to the right depicts IQ.pdf
 Find the area of the shaded region. The graph to the right depicts IQ.pdf Find the area of the shaded region. The graph to the right depicts IQ.pdf
Find the area of the shaded region. The graph to the right depicts IQ.pdfinfo794682
 
Fill in the missing values in the following table. Assume that the va.pdf
 Fill in the missing values in the following table. Assume that the va.pdf Fill in the missing values in the following table. Assume that the va.pdf
Fill in the missing values in the following table. Assume that the va.pdfinfo794682
 
Figure 4 Sample H-R Diagram QUESTIONS 1. What 3 possible properties .pdf
 Figure 4 Sample H-R Diagram QUESTIONS 1. What 3 possible properties .pdf Figure 4 Sample H-R Diagram QUESTIONS 1. What 3 possible properties .pdf
Figure 4 Sample H-R Diagram QUESTIONS 1. What 3 possible properties .pdfinfo794682
 
Fig. 6 Earthquake Hazard MapUsing Fig. 6 and the distances from qu.pdf
 Fig. 6 Earthquake Hazard MapUsing Fig. 6 and the distances from qu.pdf Fig. 6 Earthquake Hazard MapUsing Fig. 6 and the distances from qu.pdf
Fig. 6 Earthquake Hazard MapUsing Fig. 6 and the distances from qu.pdfinfo794682
 
Fill the blanks. A program in execution is known as a an Question 5.pdf
 Fill the blanks. A program in execution is known as a  an Question 5.pdf Fill the blanks. A program in execution is known as a  an Question 5.pdf
Fill the blanks. A program in execution is known as a an Question 5.pdfinfo794682
 
Fenway Athletic Club plans to offer its members preferred stock with .pdf
 Fenway Athletic Club plans to offer its members preferred stock with .pdf Fenway Athletic Club plans to offer its members preferred stock with .pdf
Fenway Athletic Club plans to offer its members preferred stock with .pdfinfo794682
 
Figure 8-10 Refer to Figure 8-10. Suppose the government imposes a ta.pdf
 Figure 8-10 Refer to Figure 8-10. Suppose the government imposes a ta.pdf Figure 8-10 Refer to Figure 8-10. Suppose the government imposes a ta.pdf
Figure 8-10 Refer to Figure 8-10. Suppose the government imposes a ta.pdfinfo794682
 
Fetile 10.90 A wok cerler has the following frve jobs waiting to be p.pdf
 Fetile 10.90 A wok cerler has the following frve jobs waiting to be p.pdf Fetile 10.90 A wok cerler has the following frve jobs waiting to be p.pdf
Fetile 10.90 A wok cerler has the following frve jobs waiting to be p.pdfinfo794682
 
Exercise 5 Pop up Windows Given the following HTML page Create an e.pdf
 Exercise 5 Pop up Windows Given the following HTML page Create an e.pdf Exercise 5 Pop up Windows Given the following HTML page Create an e.pdf
Exercise 5 Pop up Windows Given the following HTML page Create an e.pdfinfo794682
 
Falx cerebri Dural sinuses Arachnoid mater Arachnoid granulation Peri.pdf
 Falx cerebri Dural sinuses Arachnoid mater Arachnoid granulation Peri.pdf Falx cerebri Dural sinuses Arachnoid mater Arachnoid granulation Peri.pdf
Falx cerebri Dural sinuses Arachnoid mater Arachnoid granulation Peri.pdfinfo794682
 
Exercise 16-17 (Algo) Weighted average Production cost report LO P2 .pdf
 Exercise 16-17 (Algo) Weighted average Production cost report LO P2 .pdf Exercise 16-17 (Algo) Weighted average Production cost report LO P2 .pdf
Exercise 16-17 (Algo) Weighted average Production cost report LO P2 .pdfinfo794682
 
Exercise 21-6 (Algo) Preparing flexible budget performance report LO .pdf
 Exercise 21-6 (Algo) Preparing flexible budget performance report LO .pdf Exercise 21-6 (Algo) Preparing flexible budget performance report LO .pdf
Exercise 21-6 (Algo) Preparing flexible budget performance report LO .pdfinfo794682
 

Más de info794682 (20)

Find the present worth of the following cash flow diagram at i=8 per.pdf
 Find the present worth of the following cash flow diagram at i=8 per.pdf Find the present worth of the following cash flow diagram at i=8 per.pdf
Find the present worth of the following cash flow diagram at i=8 per.pdf
 
Exhibit 2.7 Refer to Exhibit 2-7. For which of the following is the a.pdf
 Exhibit 2.7 Refer to Exhibit 2-7. For which of the following is the a.pdf Exhibit 2.7 Refer to Exhibit 2-7. For which of the following is the a.pdf
Exhibit 2.7 Refer to Exhibit 2-7. For which of the following is the a.pdf
 
Find the Pumalue for the indicated hypodhesis sest whithe given stand.pdf
 Find the Pumalue for the indicated hypodhesis sest whithe given stand.pdf Find the Pumalue for the indicated hypodhesis sest whithe given stand.pdf
Find the Pumalue for the indicated hypodhesis sest whithe given stand.pdf
 
Find the indicated z score. The graph depicts the standard normal.pdf
 Find the indicated z score. The graph depicts the standard normal.pdf Find the indicated z score. The graph depicts the standard normal.pdf
Find the indicated z score. The graph depicts the standard normal.pdf
 
Find the following values by using the Poisson formula. Appendix A St.pdf
 Find the following values by using the Poisson formula. Appendix A St.pdf Find the following values by using the Poisson formula. Appendix A St.pdf
Find the following values by using the Poisson formula. Appendix A St.pdf
 
Find the area of the shaded region. The graph to the right depicts 1Q.pdf
 Find the area of the shaded region. The graph to the right depicts 1Q.pdf Find the area of the shaded region. The graph to the right depicts 1Q.pdf
Find the area of the shaded region. The graph to the right depicts 1Q.pdf
 
Find the following values by using the Poisson formula. (Round in.pdf
 Find the following values by using the Poisson formula. (Round in.pdf Find the following values by using the Poisson formula. (Round in.pdf
Find the following values by using the Poisson formula. (Round in.pdf
 
Find the area of the shaded region. The graph to the right .pdf
 Find the area of the shaded region. The graph to the right .pdf Find the area of the shaded region. The graph to the right .pdf
Find the area of the shaded region. The graph to the right .pdf
 
Find the area of the shaded region. The graph to the right depicts IQ.pdf
 Find the area of the shaded region. The graph to the right depicts IQ.pdf Find the area of the shaded region. The graph to the right depicts IQ.pdf
Find the area of the shaded region. The graph to the right depicts IQ.pdf
 
Fill in the missing values in the following table. Assume that the va.pdf
 Fill in the missing values in the following table. Assume that the va.pdf Fill in the missing values in the following table. Assume that the va.pdf
Fill in the missing values in the following table. Assume that the va.pdf
 
Figure 4 Sample H-R Diagram QUESTIONS 1. What 3 possible properties .pdf
 Figure 4 Sample H-R Diagram QUESTIONS 1. What 3 possible properties .pdf Figure 4 Sample H-R Diagram QUESTIONS 1. What 3 possible properties .pdf
Figure 4 Sample H-R Diagram QUESTIONS 1. What 3 possible properties .pdf
 
Fig. 6 Earthquake Hazard MapUsing Fig. 6 and the distances from qu.pdf
 Fig. 6 Earthquake Hazard MapUsing Fig. 6 and the distances from qu.pdf Fig. 6 Earthquake Hazard MapUsing Fig. 6 and the distances from qu.pdf
Fig. 6 Earthquake Hazard MapUsing Fig. 6 and the distances from qu.pdf
 
Fill the blanks. A program in execution is known as a an Question 5.pdf
 Fill the blanks. A program in execution is known as a  an Question 5.pdf Fill the blanks. A program in execution is known as a  an Question 5.pdf
Fill the blanks. A program in execution is known as a an Question 5.pdf
 
Fenway Athletic Club plans to offer its members preferred stock with .pdf
 Fenway Athletic Club plans to offer its members preferred stock with .pdf Fenway Athletic Club plans to offer its members preferred stock with .pdf
Fenway Athletic Club plans to offer its members preferred stock with .pdf
 
Figure 8-10 Refer to Figure 8-10. Suppose the government imposes a ta.pdf
 Figure 8-10 Refer to Figure 8-10. Suppose the government imposes a ta.pdf Figure 8-10 Refer to Figure 8-10. Suppose the government imposes a ta.pdf
Figure 8-10 Refer to Figure 8-10. Suppose the government imposes a ta.pdf
 
Fetile 10.90 A wok cerler has the following frve jobs waiting to be p.pdf
 Fetile 10.90 A wok cerler has the following frve jobs waiting to be p.pdf Fetile 10.90 A wok cerler has the following frve jobs waiting to be p.pdf
Fetile 10.90 A wok cerler has the following frve jobs waiting to be p.pdf
 
Exercise 5 Pop up Windows Given the following HTML page Create an e.pdf
 Exercise 5 Pop up Windows Given the following HTML page Create an e.pdf Exercise 5 Pop up Windows Given the following HTML page Create an e.pdf
Exercise 5 Pop up Windows Given the following HTML page Create an e.pdf
 
Falx cerebri Dural sinuses Arachnoid mater Arachnoid granulation Peri.pdf
 Falx cerebri Dural sinuses Arachnoid mater Arachnoid granulation Peri.pdf Falx cerebri Dural sinuses Arachnoid mater Arachnoid granulation Peri.pdf
Falx cerebri Dural sinuses Arachnoid mater Arachnoid granulation Peri.pdf
 
Exercise 16-17 (Algo) Weighted average Production cost report LO P2 .pdf
 Exercise 16-17 (Algo) Weighted average Production cost report LO P2 .pdf Exercise 16-17 (Algo) Weighted average Production cost report LO P2 .pdf
Exercise 16-17 (Algo) Weighted average Production cost report LO P2 .pdf
 
Exercise 21-6 (Algo) Preparing flexible budget performance report LO .pdf
 Exercise 21-6 (Algo) Preparing flexible budget performance report LO .pdf Exercise 21-6 (Algo) Preparing flexible budget performance report LO .pdf
Exercise 21-6 (Algo) Preparing flexible budget performance report LO .pdf
 

Último

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 

Último (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 

Example 9 Program uses the method isdigit to guard against improper .pdf

  • 1. Example 9: Program uses the method isdigit to guard against improper input. It Request two numbers and tind their sum. Validate the impuk. num1 = 1nput ("Enter f1rst number: ") num2 = input ("Enter second number: ") In Display sum if entrien are valid. Otherrise, 1 intorn f the user where invalid antries were made. if nun1, 1sdigit () and num2,1sdigit () : print ("The sum 1s", str (eval (num1) +eval(nun2))+.7) el1e not num1.1sdigit() : if not num 2,1adig1t() : print("Neither entry was a proper number.") else: Example 9: Program uses the method isdigit to guard against improper input. else: print("The rirst entry was not a proper number.") print("The second entry was not a proper number.") [Run] Znter flrat number: 5 Enter socond number: 51x the second entry was not a proper number.