Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://quera.org/problemset/17245/ in py #36

Open
ahkazemi2007 opened this issue Sep 20, 2023 · 1 comment
Open

https://quera.org/problemset/17245/ in py #36

ahkazemi2007 opened this issue Sep 20, 2023 · 1 comment

Comments

@ahkazemi2007
Copy link

ahkazemi2007 commented Sep 20, 2023

برای این سوال شما یه راه حل سی شارپ دادید من هم گفتم با یه روش دیگه پایتونش رو بنویسم و براتون بفرستم که اگر صلاح دونستید بفرستید. با تشکر

line1 = input()
line2 = input()
line3 = input()
len_lines = len(line1)

Taxlangs = {}
for i in range(0, len_lines, 5):
    new_code = line1[i : i + 5]
    count_star = new_code.count("*")
    Taxlangs[i] = [count_star]
for i in range(0, len_lines, 5):
    new_code = line2[i : i + 5]
    count_star = new_code.count("*")
    Taxlangs[i] += [count_star]
for i in range(0, len_lines, 5):
    new_code = line3[i : i + 5]
    count_star = new_code.count("*")
    Taxlangs[i] += [count_star]

ans_code = ""

for value in Taxlangs.values():
    if value == [5, 1, 1]:
        ans_code += "T"
    elif value == [1, 3, 2]:
        ans_code += "A"
    elif value == [2, 1, 2]:
        ans_code += "X"
    elif value == [4, 3, 2]:
        ans_code += "M"
    else:
        ans_code += "N"

print(ans_code)
@HamidMolareza
Copy link
Owner

سلام. ممنون.
منکه منتظرم گیت رو آشنا بشید خودتون بفرستین. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants