Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 678 Bytes

File metadata and controls

25 lines (16 loc) · 678 Bytes

Code Generation Prompts

This file contains a collection of prompts for generating code.

Python

Function to calculate the factorial of a number

Write a Python function that takes a non-negative integer as input and returns its factorial.

Web scraper to get the headlines from a news website

Write a Python script that uses the BeautifulSoup library to scrape the headlines from the front page of the New York Times (https://www.nytimes.com/).

JavaScript

Function to check if a string is a palindrome

Write a JavaScript function that takes a string as input and returns true if the string is a palindrome, and false otherwise.