double_23

Given an int list, return true if the list contains 2 twice, or 3 twice. The list will be length 0, 1, or 2.

This exercise was taken from codingbat.com and has been adapted for the Python language. There are many great programming exercises there, but the majority are created for Java.

Test 1

Input:

[2, 2]

Output:

True

Test 2

Input:

[3, 3]

Output:

True

Test 3

Input:

[2, 3]

Output:

False

Test 4

Input:

[3, 2]

Output:

False

Test 5

Input:

[4, 5]

Output:

False

Test 6

Input:

[2]

Output:

False

Test 7

Input:

[3]

Output:

False

Test 8

Input:

[]

Output:

False

Test 9

Input:

[3, 4]

Output:

False