René's URL Explorer Experiment


Title: [Numbers Concept Exercise]: Rethink/Redesign · Issue #2951 · exercism/python · GitHub

Open Graph Title: [Numbers Concept Exercise]: Rethink/Redesign · Issue #2951 · exercism/python

X Title: [Numbers Concept Exercise]: Rethink/Redesign · Issue #2951 · exercism/python

Description: Per issues #2946 , #2621 , #2835, #2804, #2591, and #2490 -- this exercise has gone through a lot of improvements and also complaints. Since multiple re-works and improvements have not succeeded, we have decided a complete re-design of t...

Open Graph Description: Per issues #2946 , #2621 , #2835, #2804, #2591, and #2490 -- this exercise has gone through a lot of improvements and also complaints. Since multiple re-works and improvements have not succeeded, w...

X Description: Per issues #2946 , #2621 , #2835, #2804, #2591, and #2490 -- this exercise has gone through a lot of improvements and also complaints. Since multiple re-works and improvements have not succeeded, w...

Opengraph URL: https://github.com/exercism/python/issues/2951

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Numbers Concept Exercise]: Rethink/Redesign ","articleBody":"Per issues #2946 ,  #2621 , #2835,  #2804,  #2591,  and #2490  -- this exercise has gone through a lot of improvements and also complaints.\r\n\r\nSince multiple re-works and improvements have not succeeded, we have decided a complete re-design of the `Numbers` exercise is in order.\r\n\r\n**Concept docs can be retained, or revised as needed.**  Design documents should be updated.\r\n\r\nOriginal specs for `Numbers` exercise are below: \r\n__________\r\n\r\nGoal\r\n--------\r\n\r\nThe goal of this exercise is to teach the basics of the`int` , `float` , and `complex` numeric types (`numbers`) in Python.\r\n\r\nLearning objectives\r\n-------------------\r\n\r\n*   understand the difference between `int`, `float` and `complex` numbers in Python\r\n*   understand that Python uses `j` to represent the square root of -1. appending `j` to a number defines it as _imaginary_. (**e.g.**`3j` is equivalent of `3(sqrt(-1))` -- **IF** Pythons math module allowed negative square roots...**it doesn't**).\r\n*   understand that a decimal (`.`) preceeded or followed by a number creates a `float` _literal_\r\n*   create an imaginary _literal_ via appending `j` to an `int` or `float` (**e.g.** 3.4j or 5j)\r\n*   create a `float` by casting an `int` and an `int` by casting a `float`, using the `int()` and `float()` _constructors_.\r\n*   create complex numbers by casting `int` and `float` to `complex` using the `complex()` _constructor_.\r\n*   create a complex number by adding a `float` and an `imaginary` _literal_ (e.g. 3.0 + 6j)\r\n*   understand when and how Python uses [arithmetic conversions](https://docs.python.org/3/reference/expressions.html#arithmetic-conversions) to apply arithmetic operators between these numeric types.\r\n*   apply the [arithmetic operators](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex) to each/between each of the number types (where applicable)\r\n*   perform integer (floor) division and \"regular\" (float) division and see how they differ.\r\n*   changing precision of a `float`, using `round(\u003cfloat\u003e, \u003cdigits\u003e)`\r\n\r\nOut of scope\r\n------------\r\n\r\n*   Special values for `Infinity` and `NaN`\r\n*   Special math functions for complex numbers contained in [cmath](https://docs.python.org/3.8/library/cmath.html)\r\n*   Bitwise operations on `ints`\r\n*   round numbers using `math.floor()` and `math.ceiling()`\r\n*   Issues with precision limits \u0026 [`sys.float_info`](https://docs.python.org/3/library/sys.html#sys.float_info) -- but maybe we should note these in passing, or link to them in links.\r\n*   Numpy and the numeric types defined by Numpy -- again, something for links/notes.\r\n*   Checking strings to see if they are floats. This means any test input to this exercise should not require a student to (a) catch or raise an Exception if a non-float string is passed, or (b) check to see if the string is a float. Only pass valid float strings, i.e. `\"1.032\"`.\r\n\r\nConcepts\r\n--------\r\n\r\n*   `numbers`\r\n*   `arithmetic operations`\r\n\r\nPrerequisites\r\n-------------\r\n\r\n*   `basics`\r\n\r\nResources to refer to\r\n---------------------\r\n\r\n*   [Python numeric type documentation](https://docs.python.org/3/library/stdtypes.html#typesnumeric)\r\n*   [Documentation for `int()` built in](https://docs.python.org/3/library/functions.html#int)\r\n*   [Documentation for `complex()` built in](https://docs.python.org/3/library/functions.html#complex)\r\n*   [Documentation for `float()` built in](https://docs.python.org/3/library/functions.html#float)\r\n*   [Documentation for builtin function `round()`](https://docs.python.org/3/library/functions.html#round)\r\n*   [Pythons Integer Implementation](https://rushter.com/blog/python-integer-implementation/#:~:text=Generally%2C%20In%20languages%20like%20C,are%20represented%20as%20a%20bignum.)\r\n*   [Arithmetic conversions](https://docs.python.org/3/reference/expressions.html#arithmetic-conversions)\r\n*   [Arithmetic Operations](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex) (see table and notes on the same page as numeric types.)\r\n*   [Operator Precedence in Python](https://docs.python.org/3/reference/expressions.html#operator-precedence)\r\n\r\nHints\r\n-----\r\n\r\nHints can link to the builtin function docs mentioned above, with appropriate prompts.\r\n\r\nConcept Description\r\n-------------------\r\n\r\n(_a variant of this can be used for the `v3/languages/python/concepts/\u003cconcept\u003e/about.md` doc and this exercises `introduction.md` doc._)\r\n\r\nPython has three different types of built-in numbers: integers ([`int`](https://docs.python.org/3/library/functions.html#int)), floating-point ([`float`](https://docs.python.org/3/library/functions.html#float), and complex ([`complex`](https://docs.python.org/3/library/functions.html#complex)). Fractions ([`fractions.Fraction`](https://docs.python.org/3/library/fractions.html)) and Decimals ([`decimal.Decimal`](https://docs.python.org/3/library/decimal.html#module-decimal)) are also available via import from the standard library.\r\n\r\nWhole numbers (_including hex, octals and binary numbers_) without decimal places are identified as `ints`:\r\n\r\n```python\r\n#whole number\r\n\u003e\u003e\u003e 1234\r\n1234\r\n\u003e\u003e\u003e type(1234)\r\n\u003cclass 'int'\u003e\r\n\r\n\u003e\u003e\u003e  -12\r\n-12\r\n\r\n#hex number\r\n\u003e\u003e\u003e 0x17\r\n23\r\n\u003e\u003e\u003e type(0x17)\r\n\u003cclass 'int'\u003e\r\n\r\n#octal number\r\n\u003e\u003e\u003e 0o446\r\n294\r\n\u003e\u003e\u003e type(0o446)\r\n\u003cclass 'int'\u003e\r\n\r\n#binary number\r\n\u003e\u003e\u003e 0b1100110\r\n102\r\n\u003e\u003e\u003e type(0b1100110)\r\n\u003cclass 'int'\u003e\r\n```\r\n\r\nNumbers containing a decimal point are identified as `floats`:\r\n\r\n```python\r\n\u003e\u003e\u003e 3.45\r\n3.45\r\n\u003e\u003e\u003e type(3.45)\r\n\u003cclass 'float'\u003e\r\n\r\nAppending `j` or `J` to a number creates a _imaginary number_ -- a `complex` number with a zero real part. Integers or floats can then be added to an imaginary number to create a `complex` number with both real and imaginary parts:\r\n\r\n\u003e\u003e\u003e 3j\r\n3j\r\n\u003e\u003e\u003e type(3j)\r\n\u003cclass 'complex'\u003e\r\n\r\n\u003e\u003e\u003e 3.5+4j\r\n(3.5+4j)\r\n```\r\n\r\n### Arithmetic\r\n\r\nPython fully supports arithmetic between these different number types, and will convert narrower numbers to match their less narrow counterparts when used with binary arithmetic operators (`+`, `-`, `*`, `/`, and `%`). `ints` are narrower than `floats`, which are considered narrower than `complex`. Comparisons between different number types behaves as as if the _exact_ values of those numbers were being compared:\r\n\r\n```python\r\n#the int is widened to a float here, and a float is returned\r\n\u003e\u003e\u003e 3 + 4.0\r\n7.0\r\n\r\n#the int is widened to a complex number, and a complex number is returned\r\n\u003e\u003e\u003e 6/(3+2j)\r\n(2+2j)\r\n\r\n#division always returns a float, even if integers are used\r\n\u003e\u003e\u003e 6/2\r\n3.0\r\n\r\n#if an int result is needed, you can use floor division to truncate the result\r\n\u003e\u003e\u003e 6//2\r\n3\r\n\r\n#when comparing, exact values are used\r\n\u003e\u003e\u003e 23 == 0x17\r\nTrue\r\n\r\n\u003e\u003e\u003e 0b10111 \\== 0x17\r\nTrue\r\n\r\n\u003e\u003e\u003e 6 == (6+0j)\r\nTrue\r\n```\r\n\r\nAll numbers (except complex) support the same general [arithmetic operations](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex), evaluated according to [operator precedence](https://docs.python.org/3/reference/expressions.html#operator-precedence).\r\n\r\n\r\n### Precision \u0026 Representation\r\n\r\nIntegers in Python have [arbitrary precision](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic) -- the amount of digits is limited only by the available memory of the host system.\r\n\r\nFloating point numbers are usually implemented using a `double` in C (_15 decimal places of precision_), but will vary in representation based on the host system. Complex numbers have a `real` and an `imaginary` part, both of which are represented by floating point numbers.\r\n\r\nFor a more detailed discussion of the issues and limitations of floating point arithmetic, take a look at [The Python Tutorial](https://docs.python.org/3.9/tutorial/floatingpoint.html).\r\n\r\nImplementing\r\n------------\r\n\r\nTests should be written using `unittest.TestCase`, and the test file named `numbers_test.py`.\r\n\r\nCode in the `.meta/example.py` file should only use syntax \u0026 concepts introduced in this exercise or one of its prerequisites.  \r\nPlease do not use comprehensions, generator expressions, or other syntax not previously covered. Please also follow [PEP8](https://www.python.org/dev/peps/pep-0008/) guidelines.\r\n\r\nHelp\r\n----\r\n\r\nIf you have any questions while implementing the exercise, please post the questions as comments in this issue.","author":{"url":"https://github.com/BethanyG","@type":"Person","name":"BethanyG"},"datePublished":"2022-02-21T18:48:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":16},"url":"https://github.com/2951/python/issues/2951"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f75fe1cd-69bb-a0e4-dd35-c409dc061dd3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9D76:1D9151:E8A2A0:135BE2F:69698DF4
html-safe-nonce86d34f35ab21a65279c8c693d05e1c2d8a46e941d66d8721df59468b5bb4e5d8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDc2OjFEOTE1MTpFOEEyQTA6MTM1QkUyRjo2OTY5OERGNCIsInZpc2l0b3JfaWQiOiIyMjIyNjM4NzIxNDE3NTc5NDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb6dec7ed2d8e147e66a54fa73f71c5a012b748934ee842ec564a30e6cdf3feb1
hovercard-subject-tagissue:1146128295
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/exercism/python/2951/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f6ac36a2e8a5f6eedf1b045c0d88e3e4a04fba862a85900a031b6b9689637be9/exercism/python/issues/2951
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f6ac36a2e8a5f6eedf1b045c0d88e3e4a04fba862a85900a031b6b9689637be9/exercism/python/issues/2951
og:image:altPer issues #2946 , #2621 , #2835, #2804, #2591, and #2490 -- this exercise has gone through a lot of improvements and also complaints. Since multiple re-works and improvements have not succeeded, w...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameBethanyG
hostnamegithub.com
expected-hostnamegithub.com
None3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751
turbo-cache-controlno-preview
go-importgithub.com/exercism/python git https://github.com/exercism/python.git
octolytics-dimension-user_id5624255
octolytics-dimension-user_loginexercism
octolytics-dimension-repository_id17274389
octolytics-dimension-repository_nwoexercism/python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id17274389
octolytics-dimension-repository_network_root_nwoexercism/python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseaf80af7cc9e3de9c336f18b208a600950a3c187c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/exercism/python/issues/2951#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fexercism%2Fpython%2Fissues%2F2951
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fexercism%2Fpython%2Fissues%2F2951
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=exercism%2Fpython
Reloadhttps://github.com/exercism/python/issues/2951
Reloadhttps://github.com/exercism/python/issues/2951
Reloadhttps://github.com/exercism/python/issues/2951
exercism https://github.com/exercism
pythonhttps://github.com/exercism/python
Please reload this pagehttps://github.com/exercism/python/issues/2951
Notifications https://github.com/login?return_to=%2Fexercism%2Fpython
Fork 1.5k https://github.com/login?return_to=%2Fexercism%2Fpython
Star 2.3k https://github.com/login?return_to=%2Fexercism%2Fpython
Code https://github.com/exercism/python
Issues 19 https://github.com/exercism/python/issues
Pull requests 13 https://github.com/exercism/python/pulls
Actions https://github.com/exercism/python/actions
Projects 0 https://github.com/exercism/python/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/exercism/python/security
Please reload this pagehttps://github.com/exercism/python/issues/2951
Insights https://github.com/exercism/python/pulse
Code https://github.com/exercism/python
Issues https://github.com/exercism/python/issues
Pull requests https://github.com/exercism/python/pulls
Actions https://github.com/exercism/python/actions
Projects https://github.com/exercism/python/projects
Security https://github.com/exercism/python/security
Insights https://github.com/exercism/python/pulse
New issuehttps://github.com/login?return_to=https://github.com/exercism/python/issues/2951
New issuehttps://github.com/login?return_to=https://github.com/exercism/python/issues/2951
#3287https://github.com/exercism/python/pull/3287
[Numbers Concept Exercise]: Rethink/Redesign https://github.com/exercism/python/issues/2951#top
#3287https://github.com/exercism/python/pull/3287
improve exercise 💖https://github.com/exercism/python/issues?q=state%3Aopen%20label%3A%22improve%20exercise%20%F0%9F%92%96%22
x:size/largeLarge amount of workhttps://github.com/exercism/python/issues?q=state%3Aopen%20label%3A%22x%3Asize%2Flarge%22
x:status/claimedSomeone is working on this issuehttps://github.com/exercism/python/issues?q=state%3Aopen%20label%3A%22x%3Astatus%2Fclaimed%22
https://github.com/BethanyG
https://github.com/BethanyG
BethanyGhttps://github.com/BethanyG
on Feb 21, 2022https://github.com/exercism/python/issues/2951#issue-1146128295
#2946https://github.com/exercism/python/issues/2946
#2621https://github.com/exercism/python/issues/2621
#2835https://github.com/exercism/python/issues/2835
#2804https://github.com/exercism/python/issues/2804
#2591https://github.com/exercism/python/issues/2591
#2490https://github.com/exercism/python/issues/2490
arithmetic conversionshttps://docs.python.org/3/reference/expressions.html#arithmetic-conversions
arithmetic operatorshttps://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex
cmathhttps://docs.python.org/3.8/library/cmath.html
sys.float_infohttps://docs.python.org/3/library/sys.html#sys.float_info
Python numeric type documentationhttps://docs.python.org/3/library/stdtypes.html#typesnumeric
Documentation for int() built inhttps://docs.python.org/3/library/functions.html#int
Documentation for complex() built inhttps://docs.python.org/3/library/functions.html#complex
Documentation for float() built inhttps://docs.python.org/3/library/functions.html#float
Documentation for builtin function round()https://docs.python.org/3/library/functions.html#round
Pythons Integer Implementationhttps://rushter.com/blog/python-integer-implementation/#:~:text=Generally%2C%20In%20languages%20like%20C,are%20represented%20as%20a%20bignum.
Arithmetic conversionshttps://docs.python.org/3/reference/expressions.html#arithmetic-conversions
Arithmetic Operationshttps://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex
Operator Precedence in Pythonhttps://docs.python.org/3/reference/expressions.html#operator-precedence
inthttps://docs.python.org/3/library/functions.html#int
floathttps://docs.python.org/3/library/functions.html#float
complexhttps://docs.python.org/3/library/functions.html#complex
fractions.Fractionhttps://docs.python.org/3/library/fractions.html
decimal.Decimalhttps://docs.python.org/3/library/decimal.html#module-decimal
arithmetic operationshttps://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex
operator precedencehttps://docs.python.org/3/reference/expressions.html#operator-precedence
arbitrary precisionhttps://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic
The Python Tutorialhttps://docs.python.org/3.9/tutorial/floatingpoint.html
PEP8https://www.python.org/dev/peps/pep-0008/
improve exercise 💖https://github.com/exercism/python/issues?q=state%3Aopen%20label%3A%22improve%20exercise%20%F0%9F%92%96%22
x:size/largeLarge amount of workhttps://github.com/exercism/python/issues?q=state%3Aopen%20label%3A%22x%3Asize%2Flarge%22
x:status/claimedSomeone is working on this issuehttps://github.com/exercism/python/issues?q=state%3Aopen%20label%3A%22x%3Astatus%2Fclaimed%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.