Skip to content
On this page

04_Loop_05.py

WARNING

โค้ดกาวมากครับ อย่าลอกเลย 😭😭😭

ทำเองเถอะนะครับ จะได้ทำข้อสอบได้ 🥲🥲🥲

py
from functools import reduce

needle = input()
haystack = input()

print(
    reduce(
        lambda prev, curr: prev + (curr == needle),
        "".join(map(lambda x: " " if x in "\"'(),." else x, tuple(haystack))).split(
            " "),
        0))

People who plagiarize Com Prog HW:

People who do Com Prog HW by themself:

Released under the MIT License