dimanche 1 mars 2020

How do I assign variable to a range of numbers and create several if statement Elixir

I am trying to find odd, even and divisible by 3 numbers from 1-100, I cannot find a way to assign enum.list_to(1, 100) to even show up all the way (it stops at 50) so here is what i'm trying to just assign the variable so i can create a scenario behind the variable

num = (Enum.to_list 1..100) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, ...]

Aucun commentaire:

Enregistrer un commentaire