pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/OmkarPathak/Python-Programs/pull/72/files

f="https://github.githubassets.com/assets/github-59fc16002818df36.css" /> Added jumping number program by prathimacode-hub · Pull Request #72 · OmkarPathak/Python-Programs · GitHub
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Programs/P81_JumpingNumber.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#Given a positive number N, check if the number is a Jumping number or not.
#A number is defined as a Jumping Number if all adjacent digits in it have an absolute difference of 1.
#For example 2, 23 and 4343456 are Jumping numbers but 296 and 89498 are not

num = input("Enter a number ")
lst = [int(x) for x in num]
n = len(lst)
res = 1
for ele in range(0,n-1):
if abs(lst[ele] - lst[ele+1]) != 1:
res = 0
if res == 1:
print("JUMPING NUMBER")
else:
print("NOT A JUMPING NUMBER")
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy