Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Adventures in Iterations

Avatar for vikrant vikrant
October 07, 2018

Adventures in Iterations

Presentation given at PyCon India 2018. In this talk I will show you how Python can be used to make simple to advanced iterative mathematics fun.

Avatar for vikrant

vikrant

October 07, 2018
Tweet

More Decks by vikrant

Other Decks in Programming

Transcript

  1. Hello! Vikrant Patil @vikipedia Farmer, Software Consultant and Trainer Advanced

    Programming Courses at Pipal Academy Worked at DRDO and Strand Life Sciences
  2. 1. PYTHON 2. PYTHON 3. PYT HON 4. P-Y-T H-O-N

    5. P-Y-T -H-O-N 6. PHYOTN 5. -P-Y-T H-O-N 6. HPOYNT
  3. Riffle-Shuffle Out 0 PYTHON 1 PHYOTN 2 POHTYN 3 PTOYHN

    4 PYTHON 5 PHYOTN 6 POHTYN 7 PTOYHN 8 PYTHON 9 PHYOTN In 0 PYTHON 1 HPOYNT 2 YHNPTO 3 PYTHON 4 HPOYNT 5 YHNPTO 6 PYTHON 7 HPOYNT 8 YHNPTO 9 PYTHON
  4. Iterations in Python • Lists – indexing, slicing • for

    loops • List comprehensions • Iteration patterns
  5. 17

  6. 50

  7. Sum Of Squares(SSQ) • Begin with a number a =

    1234 • Find sum of squares of its digits (1 + 4 + 9 +16 = 30) • Let this SSQ be new vale of a • Repeat above procedure observe what happens to a
  8. SSQ

  9. Kaprekar Iteration • from max number and min number by

    rearranging digits of a number. • take difference of these two numbers