Giter Site home page Giter Site logo

fizzbuzz's Introduction

FizzBuzz Number Selector

A small Python script that takes two integers within the range of 1 to 100, loops through this range, and prints out the integers. Additionally, it adds 'fizz' if the integer is divisible by 3 and 'buzz' if divisible by 5.

Prerequisites

  • Python 3.x
  • Pip

For installation instructions, check here: https://pip.pypa.io/en/stable/installation/

Installation

  • Clone the repository,
git clone https://github.com/wasabitools/fizzbuzz.git
  • Navigate to the project directory:
cd fizzbuzz
  • Install project dependencies:
pip install -r requirements.txt
  • Run the script:
python3 select_number.py

Usage

When you run the script, it will prompt you to enter two integers. Make sure these integers are within the range of 1 to 100. The script will validate your input to ensure it's a valid integer and within the specified range.

If the first input is less than the second input, it will print the selected range of numbers with 'fizz' and 'buzz' conditions. If the first input is greater or equal to the second input, you'll be prompted to enter valid inputs.

The script will then loop through the selected range, printing each number and adding 'fizz' if it's divisible by 3 and 'buzz' if divisible by 5.

Tests

This project includes a set of tests to ensure its functionality. You can run the tests using the following command:

pytest test_select_number.py

The tests cover various scenarios, including valid and invalid input, as well as the correct generation of 'fizz' and 'buzz' for numbers in the specified range.

Contributing

If you want to contribute to this project, feel free to fork the repository and submit a pull request with your changes. Make sure to follow the established coding style and conventions.

fizzbuzz's People

Contributors

wasabitools avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.