Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
EXAMPLE PROGRMS IN PYTHON
Prime or Not
-----------------
>>> for n in range(2,10):
... for x in range(2,n):
... if n%x==0:
... print n,'equals',x,'*',n/x
... break
... else:
... print n,'Is Prime'
...
2 Is Prime
3 Is Prime
4 equals 2 * 2
5 Is Prime
6 equals 2 * 3
7 Is Prime
8 equals 2 * 4
9 equals 3 * 3
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baab
te.com
Contact Us

Python

  • 2.
    Disclaimer: This presentationis prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 13.
    EXAMPLE PROGRMS INPYTHON Prime or Not ----------------- >>> for n in range(2,10): ... for x in range(2,n): ... if n%x==0: ... print n,'equals',x,'*',n/x ... break ... else: ... print n,'Is Prime' ... 2 Is Prime 3 Is Prime 4 equals 2 * 2 5 Is Prime 6 equals 2 * 3 7 Is Prime 8 equals 2 * 4 9 equals 3 * 3
  • 16.
    If this presentationhelped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baab te.com
  • 17.