Skip to content

Added Minimum and Maximum Number support in get_int() and get_float() #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Added Minimum and Maximum Number support in get_int() and get_float() #148

wants to merge 1 commit into from

Conversation

MuhammadHassanRazaa
Copy link

I have implemented two overloads of get_int() and get_float(). Minimum and Maximum value can be passed and then get_int() and get_float() will give input within a range specified.

By using this user can write clean code as they don't have to write loops to checks whether the input is in range.

@kzidane
Copy link
Member

kzidane commented Mar 10, 2021

It is actually by design that these functions only accept a prompt.

@kzidane kzidane closed this Mar 10, 2021
@dmalan
Copy link
Member

dmalan commented Mar 10, 2021

Indeed, this library's designed to mimic the behavior of https://github.com/cs50/libcs50 and only address input, not validation. (The latter is part of CS50's earliest homework assignments.) Thank you, though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants