Given a list of non-negative integers, return whether or not that list is all the same number.
Rules
- Input and output can be taken/given in any reasonable and convenient format
- Truthy/Falsey values can be represented as any value of your choice as long as it's reasonable and relatively consistent (e.g.
1
for falsey and>= 2
for truthy is fine) - There will always be at least 1 item in the input list
- The list items are guaranteed to be in the range
[0, 9]
(\$0 \le n \le 9\$) - Standard loopholes apply
This is code golf, so the shortest program in each language wins. I've made a community wiki answer for trivial answers, so feel free to submit potentially longer programs.
Test Cases
[1, 1, 1, 1, 1, 1, 1] -> True
[1, 2, 3, 4] -> False
[6, 9, 6, 9, 6] -> False
[6] -> True
[7, 7] -> True
[4, 2, 0] -> False
Input and output can be taken/given in any reasonable and convenient format
, that's pretty standard for more trivial challenges \$\endgroup\$'3'
instead of number3
; or producing the output via program exit code. What I mean is what options for output are allowed: two consistent values? Non-consistent truthy/falsy? One consistent value for truthy and any inconsistent values for falsy? \$\endgroup\$