Skip to content

Why are the correct answers preset? #878

@DrAK47-bruh

Description

@DrAK47-bruh

in the lesson about lists on learnpython.org there is an exercise. the goal was to create a string that would mach the condisions below.
the conditions are:

Length should be 20

print("Length of s = %d" % len(s))

First occurrence of "a" should be at index 8

print("The first occurrence of the letter a = %d" % s.index("a"))

Number of a's should be 2

print("a occurs %d times" % s.count("a"))

Check how a string starts

if s.startswith("Str"):
print("String starts with 'Str'. Good!")

Check how a string ends

if s.endswith("ome!"):
print("String ends with 'ome!'. Good!")

the answer that is preset is:
s = "Strings are awesome!"

my answer is:
s = "Str thera! whatlome!"

which is also correct. the "correct" answer is so secific that i don't think you could do this exercise without "show solution"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions