Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

first_last6

# first_last6 - https://codingbat.com/prob/p181624
# Given an array of ints, return True if 6 appears as either the first or last element in the array. The array will be length 1 or more.
# first_last6([1, 2, 6]) = True
# first_last6([6, 1, 2, 3]) = True
# first_last6([13, 6, 1, 2, 3]) = False 
def first_last6(nums):
  
  if nums[0] == 6 or nums[-1] == 6:
    return True
  
  return False
Comment

PREVIOUS NEXT
Code Example
Python :: python ocr pdf dataframe 
Python :: jet 4 access python password 
Python :: alan watts 
Python :: spark write progress bar jupyter 
Python :: selecting letters in a row 
Python :: pandas show head and tail 
Python :: ler arquivo xls no pandas 
Python :: call for a last number in series python 
Python :: what should I do when the keras image datagenerato is nit working 
Python :: par e impar pygame 
Python :: train chatterbot using yml 
Python :: python hash md5 unicode 
Python :: python round and map function 
Python :: Create a new list from a list when a certain condition is met 
Python :: dip programming language 
Python :: python fibonacci sequence while loop 
Python :: make my own rabbit bomb using python 
Python :: conversion of int to a specified base number 
Python :: Django pull from Google Sheets 
Python :: pandas print nonzero in series 
Python :: what is te meaning of nested in python 
Python :: how to implement nfa in python 
Python :: converting string key to int py 
Python :: multiplication objects 
Python :: apk calculate python 
Python :: scipy z value to pvalue 
Python :: python deconstruct tuple 
Python :: pyttsx3 Using an external event loop¶ 
Python :: Code Example of Comparing None with empty string 
Python :: split x and y pandas 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =