Skip to content

Discrete Structures

Data Types

Project Goals

This assignment invites you to run and observe two Python programs called compare-variables and demonstrate-variable-limitations. Instead of using the Poetry tool for managing dependencies and packaging these programs, which the technical skills advise as a best practice, these programs are scripts, without any dependencies on other Python packages, that you can run through the Python interpreter. As you learn a new way to run a Python program, this project offers you the opportunity to ensure that you understand how to (i) understand the representation of float-point variables and (ii) the time and space limitations associated with performing computations with numbers. Ready to explore some of the limitations of data variables in Python? Okay, let's get started!

Project Access

If you are a student enrolled in a Computer Science class at Allegheny College, you can access this assignment by clicking the link provided to you in Discord. Once you click this link it will create a GitHub repository that you can clone to your computer by following the general-purpose instructions in the description of the technical skills. Specifically, you will need to use the git clone command to download the project from GitHub to your computer. Now you are ready to add source code and documentation to the project!


If you are an emerging proactive programmer who is not enrolled in a Computer Science class at Allegheny College, you can still work on this assignment! To get started, you should click the "Use this template" icon in the data-types-starter GitHub repository and create your own version of this project's source code. After creating your GitHub repository, you can follow all of the other steps!

Code Survey

If you change into the source directory of your GitHub repository, you will see two Python files called and You can run the program by typing python in your terminal window. What output does the program produce? Can you explain why it produces this output? The key to understanding this segment of source code is to notice that the conditional logic in lines 1 through 4 use a programmer's decimal approximation of \(\frac{1}{3}\) while lines 5 through 8 use the fraction itself. What does this output tell you about the difference between .33333 and (1/3) in the Python language?

if .33333 + .33333 + .33333 == 1:
    print(".33333 + .33333 + .33333 is equal to 1")
    print(".33333 + .33333 + .33333 is not equal to 1")
if (1/3) + (1/3) + (1/3) == 1:
    print("1/3 + 1/3 + 1/3 is equal 1")
    print("1/3 + 1/3 + 1/3 is not equal 1")

The second Python program is called because it uses the exponentiation operator, written as **, to raise different numbers to different powers. As shown on line 1 in the following excerpt from this program, it is feasible to efficiently perform the computation 2**2**8, written as \(2^{2^8}\) using mathematical notation. Line 3 also shows that it is possible to efficiently compute the value of \(2^{2^{10}}\) using the Python expression 2**2**10. Although not shown in the following source code segment, the script also has commented-out source code that performs the computation 2**2**100. If you un-comment this source code and run the program by typing python what does the output tell you about the challenges of efficiently performing exponentiation?

feasible_number = 2**2**8
print(f"The value of a feasible number is {feasible_number}")
another_feasible_number = 2**2**10
print(f"The value of another feasible number is {another_feasible_number}")

Running Checks

Since this project does not use Poetry to manage project dependencies and virtual environments, it does not support the use of commands like poetry run task test. However, you can leverage the relevant instructions in the technical skills to run the command gatorgrade --config config/gatorgrade.yml to check your work. If gatorgrade shows that all checks pass, you will know that you made progress towards correctly implementing and writing about this project's two programs.


Did you know that GatorGrade and GatorGrader are open-source Python programs implemented by many proactive programmers? If you finish this source code survey and have extra time, please brainstorm some new features that you think these two tools should have, explain your idea by raising an issue in the relevant project's GitHub repository, and take the first step towards implementing and testing your idea. If the maintainers of these tools accept your new feature then you will have helped to improve the experience of other people who use GatorGrade and GatorGrader!

Project Reflection

Once you have finished all of the previous technical tasks, you can use a text editor to answer all of the questions in the writing/ file. Since this is a source code survey, you should provide output from running each of the provided Python programs on your own laptop and then explain how the program's source code produced that output. A specific goal for this project is to ensure that you can explain how Python programs should use integer numbers and exponentiation in an efficient and correct fashion.

Project Assessment

Since this project is source code survey, it is aligned with the remembering and understanding levels of Bloom's taxonomy. You can learn more about how a proactive programming expert will assess your work by examining the assessment strategy. From the start to the end of this project you may make an unlimited number of reattempts at submitting source code and technical writing that meet the project's specification.


Before you finish all of the required deliverables required by this project is worth pausing to remember that the instructor will give advance feedback to any learner at Allegheny College who requests it through GitHub and Discord at least 24 hours before the project's due date! Seriously, did you catch that? This policy means that you can thoroughly understand the ways to improve your project before its final assessment! To learn more about this opportunity, please read the assessment strategy for this site.

Seeking Assistance

Emerging proactive programmers who have questions about this project are invited to ask them in either the GitHub discussions forum or the Proactive Programmers Discord server. Before you ask your question, please read the advice concerning how to best participate in the Proactive Programmers community. If you find a mistake in this project, please describe it and propose a solution by creating an issue in the GitHub Issue Tracker.

Updated: 2023-02-24   Created: 2021-09-16
Create an issue with feedback about "Data Types"
Check out all the exciting topics covered on this site