Sunday, 13 July 2014

Floyd's Triangle

Floyd's Triangle :

1
2  3
4  5  6
7  8  9  10
..
and so on ..


Python 2.7 code to print Floyd Triangle :



  1. # Floyd's triangle
  2. # https://beginer2cs.blogspot.com
  3. if __name__=='__main__'#check for namespace
  4.     row = int(raw_input('Enter Number of row of floyd triangeyou wanna print : '))
  5.     x=1 #initiate from x=1
  6.    
  7.     for i in range(1,row+1):  #this will create floyd triange
  8.         st=''    
  9.         for j in range(i):
  10.             st=st+' '+str(x)
  11.             x +=1
  12.         print st


OUTPUT :
Floyd triangle in Python

2 comments:

  1. Are you interested in attaining enlightenment and personal growth?

    Try doing the following two yoga exercises daily:

    Sodarshan Kriya Yoga

    Sat Nam Kriya Yoga


    Are you interested in preventing and curing cancer, Alzheimer's, high blood pressure, and many other common diseases using an inexpensive, natural indian spice called turmeric?

    Take two teaspoons full of turmeric powder mixed with a cup of warm soy milk (or any kind of non-dairy milk that you'd like). Also eat 2 or 3 black peppercorns along with it, as the pepper helps your body absorb the turmeric better. You also need fat for the turmeric to be absorbed properly, which is why drinking turmeric mixed in water won't work. You have to drink it with milk or some fatty based liquid. Do this twice a day and you will start to feel amazing within a couple of weeks.


    Lastly, please read the following two ancient indian scriptures which talk about the divine love of God:

    Ananda Vrindavan Campu PDF

    Govinda Lilamrta PDF


    If you have any questions about yoga, meditation, spirituality, or natural cures, feel free to email me at delugar@mail2tor.com

    ReplyDelete
  2. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Data Science with Python , kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on TECHNOLOGY. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Sangita Mohanty
    MaxMunus
    E-mail: sangita@maxmunus.com
    Skype id: training_maxmunus
    Ph:(0) 9738075708 / 080 - 41103383
    http://www.maxmunus.com/

    ReplyDelete

THANKS FOR UR GREAT COMMENT

Blogger Widgets