#🔒 Yahtzee code not getting 100%

26 messages · Page 1 of 1 (latest)

heavy skiff
#
  • keep getting 50%
  • not allowed to edit the test file
teal wadiBOT
#

@heavy skiff

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

heavy skiff
#

test file

#

code I can edit

trim inlet
#

What is your task? Do you understand it?

heavy skiff
heavy skiff
#

this is what my teacher said

#

Making Your Own Modules - Python

Often when creating a larger project, code is organized into functions as we have already seen.  You can also further organize your code by adding functions to a separate file and creating  your own module.  We have already used built-in modules in Python such as random and math.  This week you will test your Yahtzee functions by using the concept of a module. The file yahtzee.py is the module containing the functions, and the file yahtzeeTests.py is what you will run to test whether your functions work properly.

Task: Part 1 - Testing your Yahtzee Functions

Copy the files below:  yahtzeeTests.py and yahtzee.py into the same folder

Run the yahtzeeTests.py file and determine what your score is.

Complete the functions in yahtzee.py that determine the different rankings in a Yahtzee game. Run the yahtzeeTests.py file until 100% of the tests pass.

Notice how the yahtzeeTests.py file accesses your functions - see the top line:  from yahtzee import *.

trim inlet
#

Complete the functions in yahtzee.py that determine the different rankings in a Yahtzee game.

heavy skiff
#

Task :

Create the following boolean functions (value produced is either True or False),

using the following assumption. The values of the dice are represented by the

arguments d1, d2, d3, d4, and d5 where

0 < d1 <= d2 <= d3 <= d4 <= d5 <= 6 ...

trim inlet
#

So what's your question?

heavy skiff
#

i cant get it to 100%

#

i was just giving u the task my teacher told us

trim inlet
#

You're supposed to replace return True in the functions with the correct code

#

the test run will show 100% if your code passed all the checks

heavy skiff
#

.ok

#

ok

#

i cant seem to figure it out

#

may you help me with just test 2 to pass and ill go off that

heavy skiff
#

the more I touch it the more it gets worse

teal wadiBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.