Python Problem Solving | Kaprekar's Constant | Python Bytes

Veröffentlicht am: 22 March 2022
auf dem Kanal: Atharv Kolhar
557
15

Question:
The number 6174 is known as Kaprekar's constant, after the mathematician
who discovered an associated property: for all four-digit numbers with at
least two distinct digits, repeatedly applying a simple procedure eventually
results in this value. The procedure is as follows:

1. For a given input x, create two new numbers that consist of the digits in
x in ascending and descending order.
2. Subtract the smaller number from the larger number.
For example, this algorithm terminates in three steps when starting from 1234:

4321 - 1234 = 3087
8730 - 0378 = 8352
8532 - 2358 = 6174
Write a function that returns how many steps this will take for a given input N.

Chapters:
0:00 Intro
0:12 Problem Explanation and Logic
4:07 Coding Section
09:38 Closing Statements

Python Byte Git Repository
https://github.com/amkolhar/PythonBytes

__________________________________________________________
   • Video 1 | Introduction to Python Bytes and...  

Solve Interview questions in Python.

Python is a popular coding language of 2022 and is gaining a lot of applications in Artificial Intelligence, Machine Learning, Data Science, and Autonomous Driving.

Python Bytes is a series of beginner-level tutorials that will help budding programmers learn about the basics of Python coding and also experts to revise the building blocks of Python coding.

Python and Django are used for developing applications like YouTube, Instagram, and DropBox

   / @atharvkolhar  

Discord Server:
  / discord  

Follow me on:
Github: https://github.com/amkolhar

   / @atharvkolhar  



#PythonforBeginners #learnPython #PythonBytes #Python
#easypython #atharv #learnpython #ProblemSolving #strobogrammaticNumber #String #Recursive


Auf dieser Seite können Sie das Online-Video Python Problem Solving | Kaprekar's Constant | Python Bytes mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Atharv Kolhar 22 March 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 557 Mal angesehen und es wurde von 15 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!