Issue in Part 2 Exercise: Story
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- testing-qa
Research direction
Start with the Part 2 Story exercise and the PythonEditorTest cases named test_part1b and test_part2b. Run both failing inputs to verify that each part is tested with its own appropriate termination input and that the repeated word in part 2 is handled as intended. Done means both tests pass without one part's input assumptions affecting the other.
Written by the indexing model from the issue text.
Description
For the exercise Story in part 2 it has two parts namely part 1 and part 2 and only 1 code runner provided for both parts.
When testing code for part 1
story = ""
while True:
word = input("Please type in a word: ")
if word == "end":
break
story += word + " "
print(story)
'hello world' != ''
- hello world
+
: With the input
hello
world world
your program should print out:
hello world
your program printed out:
The testcase does not have the word end so the program actually never halts.
When testing code for part 2
story = ""
while True:
word = input("Please type in a word: ")
if word == "end" or word in story:
break
story += word + " "
print(story)
'Once upon a time there was a girl' != 'Once upon a time there was'
- Once upon a time there was a girl
? -------
+ Once upon a time there was
: With the input
Once
upon
a
time
there
was
a
girl
end
your program should print out:
Once upon a time there was a girl
your program printed out:
Once upon a time there was
The testcase is flawed because the input has the word a twice so the program should break out of the loop here Once upon a time there was.
- Dominant language
- JavaScript
- Stars
- 77
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rage/programming-26
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
rage/programming-26#74 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
rage/programming-26#68 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
rage/programming-26#62 ·
-
A typo in Part 4 Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
rage/programming-26#56 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
rage/programming-26#55 ·
All issues in rage/programming-26
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·