Skip to content

vanillaextractor/Hackerrank-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Hackerrank-python

Python Certification Test Solutions

This repository contains solutions to coding challenges from the HackerRank Python certification test. These solutions demonstrate proficiency in Python programming and problem-solving.


Challenges

1. Vending Machine

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.

2. String Transformation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published