Python
Hangman is an equivalent of a classic word guessing game played between two or more players. One player (a computer) thinks of a word and the other player (a user) attempts to guess it by suggesting letters within a certain number of attempts.
Expects a command-line argument representing the number of Bitcoins. If the argument cannot be converted to a float, it will terminate with an error. Queries an API for the current Bitcoin price, retrieves the data as a JSON object, extracts the price.
A machine sells Coca-Cola for 50 cents, accepting only 25, 10, and 5 cent coins. Once the user inputs 50 cents or more, output the change owed. The program ignores any input that isn't an accepted denomination.
Prompts the user to enter grocery items, one per line, and continues accepting input until Control-D is pressed (indicating the end of input). Outputs a sorted grocery list in uppercase, prefixed with the count of each item. Input is treated case-insensitively.
Converts times from "9:00 AM to 5:00 PM" format, ensuring that "AM" and "PM" are capitalized and have a space before them. It checks that the input times are valid and raises a ValueError if the format is incorrect or the times are invalid.
Prompts the user to enter a date, anno Domini, in either MM/DD/YYYY format or in the Month day, year format. It then outputs the date in YYYY-MM-DD format. If the input is not a valid date in either of these formats, the user is prompted to try again.