This repository contains solutions to coding challenges from the HackerRank Python certification test. These solutions demonstrate proficiency in Python programming and problem-solving.
Create a VendingMachine
class that simulates a simple vending machine. The machine holds a certain number of items, each with a fixed price.
- Users can buy items by specifying the number of items and inserting money.
- The machine should keep track of remaining items and return the correct change.
- If there are not enough items or insufficient money, appropriate errors or messages should be handled.
Write a function that transforms each word in a sentence based on the alphabetical comparison of consecutive characters.
- For each word, the first character remains unchanged.
- For every other character:
- If it is alphabetically greater than the previous character, convert it to uppercase.
- If it is alphabetically smaller, convert it to lowercase.
- If it is the same, leave it unchanged.
- Return the transformed sentence as a single string.