← Back to challenges

Programming Polyglot

PythonHardnumbersarraysbit_operations

Instructions

Create a function that takes a number that represents a person's programming language score, and returns an alphabetised list of programming languages they are proficient in. Arbitrarily assigned points for each language are listed below:

LanguagePoints
C#1
C++2
Java4
JavaScript8
PHP16
Python32
Ruby64
Swift128

Examples

get_languages(25) ➞ ["C#", "JavaScript", "PHP"]

get_languages(100) ➞ ["Java", "Python", "Ruby"]

get_languages(53) ➞ ["C#", "Java", "PHP", "Python"]

Notes

Easier using bitwise operations.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.