Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions Basics/Jumping Number/jumping_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#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")
6 changes: 5 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ Place: India<br/>
About: Code is Life!<br/>
Programming Language: Java, JS, C, Python ,html ,css<br/>
Email: dsameer33@gmail.com<br/>


Name: [Prathima Kadari](https://github.com/prathimacode-hub)<br/>
Place: India<br/>
About: Be the better version of mine!<br/>
Programming Language: C, C++, Python<br/>