Code Samples

Published on

Table of Contents

JavaScript Link to this section

js
export function greet(name) {
  return `Hello, ${name}!`;
}
console.log(greet('trainsh'));

Python Link to this section

python
from datetime import date

def days_in_year(year: int) -> int:
    return 366 if (year % 400 == 0) or (year % 4 == 0 and year % 100 != 0) else 365

print(date.today(), days_in_year(date.today().year))