Author Topic: Day 8 - Function Parameters & Caesar Cipher  (Read 730 times)

TheBreh

  • Administrator
  • Newbie
  • *****
  • Posts: 31
    • View Profile
Day 8 - Function Parameters & Caesar Cipher
« on: November 14, 2021, 05:19:01 pm »
Discuss here.

Share on Facebook Share on Twitter


Secure Da Bag

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Day 8 - Function Parameters & Caesar Cipher
« Reply #1 on: November 27, 2021, 12:25:16 pm »
Create a function
Spoiler (hover to show)

Function with multiple parameters
Spoiler (hover to show)

Functions with named parameters
Spoiler (hover to show)

Challenge
Spoiler (hover to show)

Challenge
Spoiler (hover to show)

Project
Spoiler (hover to show)

Obreh Winfrey

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Day 8 - Function Parameters & Caesar Cipher
« Reply #2 on: November 28, 2021, 09:11:03 pm »
Pay attention to isPrime, that's a method implementation that comes up in job interviews from time to time. Prime numbers are only divisible by 1 and themselves, which allows you to shortcut some math by checking from 2 to n / 2. It's an optimization that pays off for large n. I think there's also some other mathematical trickery you can employ on that, but at that point you really aren't solving a computer science problem, but a math problem - as an interviewer I'd never expect or even want the mathematical answer.