Skip to content

Instantly share code, notes, and snippets.

@loriculberson
Created March 21, 2020 10:45
Show Gist options
  • Select an option

  • Save loriculberson/8f6bb99e2a40784c2e41d25d8fd094c2 to your computer and use it in GitHub Desktop.

Select an option

Save loriculberson/8f6bb99e2a40784c2e41d25d8fd094c2 to your computer and use it in GitHub Desktop.
Level 1 Warm ups for students
1. Write a function that takes in an integer and outputs the sum of all the numbers from 1 to that integer.
Input: 2
Output 3

Input : 4
Output: 10

Input: 10
Output: 55
2. Write a function that takes in an array of numbers and outputs the maximum number

Input: [1,2,3]
Output: 3

Input: [3,6,4,5,2,1]
Output: 6
3. Write a function that takes in a string and outputs the number of vowels (not counting y).

Input: "hello"
Output: 2

Input: "you are great!"
Output: 6

Input: "why?"
Output: 0
4. Write a function that takes in a single word as a string and returns true if it's a palindrome and false otherwise (a palindrome is spelled the same way forwards and backwards).

Input: "noon"
Output: true

Input: "horse"
Output: false

Input: "racecar"
Output: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment