id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

tmhscs@gmail.com python > logic_closeOrFarN
prev  |  next  |  chance

Given an integer list, return "close" if any two values in the list are duplicates or differ by 1. Return "far" if no values in the list are the same or differ by 1.


logic_closeOrFarN([1, 2, 3, 4, 5]) → 'close'
logic_closeOrFarN([1, 3, 6, 9, 0]) → 'close'
logic_closeOrFarN([3, 5, 6, 8, 10]) → 'close'

...Save, Compile, Run (ctrl-enter)

def logic_closeOrFarN(list):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Post-solution available

Copyright Nick Parlante 2017 - privacy