├── تکنولوژی ├── بلاگ │ ├── blog │ │ ├── views.py │ │ ├── __init__.py │ │ ├── migrations │ │ │ ├── __init__.py │ │ │ ├── 0002_alter_comment_blog_post.py │ │ │ └── 0001_initial.py │ │ ├── tests.py │ │ ├── admin.py │ │ ├── apps.py │ │ └── models.py │ ├── tests │ │ ├── __init__.py │ │ └── testsample.py │ ├── Challenge │ │ ├── __init__.py │ │ ├── wsgi.py │ │ ├── urls.py │ │ └── settings.py │ ├── requirements.txt │ └── manage.py ├── chesstml │ ├── chesstml │ │ └── chesstml │ │ │ ├── python_requirements.txt │ │ │ ├── htmlsampletest1.html │ │ │ ├── solution.py │ │ │ ├── htmlsampletest2.html │ │ │ └── testssample.py │ └── chesstml.zip ├── ثبت‌نام │ ├── source.zip │ └── source.py ├── نظریه ریسمان │ └── test.py ├── Simple HTML │ └── index.html ├── عکس تار │ ├── quera.svg │ └── index.html └── صفحه‌ی پاسخگو │ └── responsive.html ├── مسابقه ├── غُل‌بانو و دوقلوهایش │ └── main.py ├── پشمال‌آقا │ └── main.py ├── فرمانده‌ی بازنشسته │ └── main.py ├── بلندگو │ └── main.py ├── جمع بزرگان │ └── main.py ├── کمک به کاپی │ └── main.py ├── سوال نفس‌گیر │ └── main.py ├── صبا و سوال ساده │ └── main.py ├── کاکتوس‌های پردردسر │ └── main.py ├── تی‌شرت برنده │ └── main.py ├── شطرنج حرفه‌ای │ └── main.py ├── سوپ سبزیجات │ └── main.py ├── تست بینایی │ └── main.py ├── چاپ برعکس │ ├── main2.py │ └── main.py ├── بازگشت از بوستان │ └── main.py ├── کلید چراغ │ └── main.py ├── سوراخ موش │ └── main.py ├── جدول ضرب گنده │ └── main.py ├── همایش زندگی بهتر │ └── main.py ├── بهداشت و سلامت │ └── main.py ├── مشق امشب باقر │ └── main.py ├── نوبرانه │ └── main.py ├── سوال برنامه نویسی برنامه نویسی سوال │ └── main.py ├── رشته فیبوناچی │ └── main.py ├── کم ارزشترین رقم 9 نیست! │ └── main.py ├── استخدام در ترب │ ├── main.py │ └── main2.py ├── یک سوال ساده │ └── main.java ├── شارژ موبایل │ └── main.java ├── آسمان شکر آباد │ └── main.py ├── سوال زرد │ └── main.java ├── معجون سوسک قرمز و اسفناج گندیده │ └── main.py ├── اسم‌ها │ └── main.py ├── روز آزادی بیان در برره │ └── main.py ├── پرگوشت │ └── main.py ├── یخدارچی │ └── main.java ├── باب و کلید تلویزیون │ └── main.py ├── صفحه‌کلید انتخاباتی │ └── main.py ├── رژیم سخت │ └── main.py ├── آخ جون طرف نیست! │ └── main.py ├── تو چقدر اضافه وزن داری؟ │ └── main.py ├── بتایپ!!!!!!!!!!!!! │ └── main.py ├── خر در چمن فراوونه!! │ └── main.java ├── تک رقمی │ └── main.py ├── سطح مکعب │ └── main.py ├── در جستجوی ترب │ └── main.py ├── مجید، میلاد، رشته‌سازی │ └── main.py ├── دایره عجیب │ └── main.py ├── وسط صندلی عقب │ └── main.py ├── دو نقطه خط │ └── main.java ├── صدگان خسته │ └── main.py ├── آزمون تستی │ └── main.py ├── بازی یک، سه، پنچ │ └── main.py ├── شماره رند │ └── main.py ├── ام سین │ └── main.java ├── مثلث خیام پاسکال │ └── main.py └── پاکسازی │ └── main.py ├── دانشگاهی ├── عدد خودمقلوب │ └── main.py ├── ب.م.م │ └── main.py ├── سیگماگیر │ └── main.py ├── ب.م.م و ک.م.م │ └── main.py ├── دنباله‌ی فیبوناچی │ └── main.py ├── فاکتوریل │ └── main.java ├── چاپ لوزی │ └── main.py ├── تاریخ تولد │ └── main.java ├── اعداد فیثاغورثی │ ├── main.py │ └── main.java ├── لوزی‌های ستاره‌ای │ └── main.py ├── ماکزیمم │ └── main.java ├── مثلث خیام │ └── main.py ├── کامل بودن یا نبودن │ └── main.java ├── توان 2 │ └── main.java ├── اول‌بینی │ └── main.py ├── یافتن عدد اول │ └── main.py ├── فرزاد فیلم‌بین │ └── main.py ├── چاپ مربع │ └── main.java ├── کار با اعداد اعشاری │ └── main.py ├── اعداد اول │ └── prime.java ├── عدد چاپ کن │ └── main.java └── جمع اعداد │ └── main.py ├── LICENSE ├── .gitignore └── README.md /تکنولوژی/بلاگ/blog/views.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/blog/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/Challenge/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/blog/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/requirements.txt: -------------------------------------------------------------------------------- 1 | django==4.1.13 2 | -------------------------------------------------------------------------------- /تکنولوژی/chesstml/chesstml/chesstml/python_requirements.txt: -------------------------------------------------------------------------------- 1 | bs4 -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/blog/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | -------------------------------------------------------------------------------- /مسابقه/غُل‌بانو و دوقلوهایش/main.py: -------------------------------------------------------------------------------- 1 | s = input() 2 | print(s[::-1]) 3 | -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/blog/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /مسابقه/پشمال‌آقا/main.py: -------------------------------------------------------------------------------- 1 | n, k, p = input().split(" ") 2 | print(int(int(n) * float(k) * int(p))) 3 | -------------------------------------------------------------------------------- /تکنولوژی/ثبت‌نام/source.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erfanghorbanee/quera-answers/HEAD/تکنولوژی/ثبت‌نام/source.zip -------------------------------------------------------------------------------- /مسابقه/فرمانده‌ی بازنشسته/main.py: -------------------------------------------------------------------------------- 1 | print("Bebakhshid, vali shoma nemitoonin too in mosabeghe sherkat konin :(") 2 | -------------------------------------------------------------------------------- /تکنولوژی/chesstml/chesstml.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erfanghorbanee/quera-answers/HEAD/تکنولوژی/chesstml/chesstml.zip -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/blog/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BlogConfig(AppConfig): 5 | name = "blog" 6 | -------------------------------------------------------------------------------- /دانشگاهی/عدد خودمقلوب/main.py: -------------------------------------------------------------------------------- 1 | a = input() 2 | b = a[::-1] 3 | 4 | if a == b: 5 | print("YES") 6 | else: 7 | print("NO") 8 | -------------------------------------------------------------------------------- /تکنولوژی/نظریه ریسمان/test.py: -------------------------------------------------------------------------------- 1 | s = input() 2 | ss = input() 3 | 4 | if s in ss: 5 | print(1) 6 | else: 7 | print(0) 8 | -------------------------------------------------------------------------------- /مسابقه/بلندگو/main.py: -------------------------------------------------------------------------------- 1 | s = input() 2 | print(s) 3 | i = 0 4 | while i < len(s) - 1: 5 | i += 1 6 | s = s[i] * (i + 1) + s[i + 1 :] 7 | print(s) 8 | -------------------------------------------------------------------------------- /تکنولوژی/chesstml/chesstml/chesstml/htmlsampletest1.html: -------------------------------------------------------------------------------- 1 | alt -------------------------------------------------------------------------------- /مسابقه/جمع بزرگان/main.py: -------------------------------------------------------------------------------- 1 | a = int(input()) 2 | op = input() 3 | b = int(input()) 4 | 5 | if op == "+": 6 | print(a + b) 7 | elif op == "*": 8 | print(a * b) 9 | -------------------------------------------------------------------------------- /تکنولوژی/Simple HTML/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /مسابقه/کمک به کاپی/main.py: -------------------------------------------------------------------------------- 1 | inp = input().split(" ") 2 | s = "" 3 | n = int(inp[0]) 4 | 5 | for i in range(n): 6 | s += "copy of " 7 | 8 | s += inp[1] 9 | 10 | print(s) 11 | -------------------------------------------------------------------------------- /مسابقه/سوال نفس‌گیر/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | ai = input().split(" ") 3 | bi = input().split(" ") 4 | 5 | x = 0 6 | for i in range(n): 7 | x += int(ai[i]) * int(bi[i]) 8 | 9 | print(x) 10 | -------------------------------------------------------------------------------- /مسابقه/صبا و سوال ساده/main.py: -------------------------------------------------------------------------------- 1 | from math import floor 2 | 3 | inp = input().split(" ") 4 | n = int(inp[0]) 5 | 6 | for i in range(0, int(inp[1])): 7 | n = n / 2 8 | 9 | print(floor(n)) 10 | -------------------------------------------------------------------------------- /مسابقه/کاکتوس‌های پردردسر/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | gp = input().split(" ") 3 | 4 | for i in range(n): 5 | if int(gp[i]) > 3: 6 | print("*") 7 | else: 8 | print(int(gp[i]) * "*") 9 | -------------------------------------------------------------------------------- /دانشگاهی/ب.م.م/main.py: -------------------------------------------------------------------------------- 1 | def gcd(a, b): 2 | if b == 0: 3 | return a 4 | else: 5 | return gcd(b, a % b) 6 | 7 | 8 | A = int(input()) 9 | B = int(input()) 10 | print(gcd(A, B)) 11 | -------------------------------------------------------------------------------- /مسابقه/تی‌شرت برنده/main.py: -------------------------------------------------------------------------------- 1 | xl = input().split(" ") 2 | winner = input().split(" ") 3 | 4 | if int(xl[0]) >= int(winner[0]) and int(xl[1]) >= int(winner[1]): 5 | print("yes") 6 | else: 7 | print("no") 8 | -------------------------------------------------------------------------------- /مسابقه/شطرنج حرفه‌ای/main.py: -------------------------------------------------------------------------------- 1 | list = [1, 1, 2, 2, 2, 8] 2 | vorudi = input().split() 3 | for i in range(6): 4 | list[i] = list[i] - int(vorudi[i]) 5 | 6 | print(list[0], list[1], list[2], list[3], list[4], list[5]) 7 | -------------------------------------------------------------------------------- /مسابقه/سوپ سبزیجات/main.py: -------------------------------------------------------------------------------- 1 | n, k, s = input().split(" ") 2 | n = int(n) 3 | k = float(k) 4 | s = float(s) 5 | 6 | if s >= (n * k): 7 | print("Kafie!") 8 | else: 9 | print("Na! yeki bayad bere sabzi bekhare") 10 | -------------------------------------------------------------------------------- /مسابقه/تست بینایی/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | str1 = input() 3 | str2 = input() 4 | k = 0 # tedade horufe motafavet 5 | 6 | for i in range(0, n): 7 | if str1[i] != str2[i]: 8 | k += 1 9 | 10 | print(k) 11 | -------------------------------------------------------------------------------- /مسابقه/چاپ برعکس/main2.py: -------------------------------------------------------------------------------- 1 | list = [] 2 | 3 | while True: 4 | n = int(input()) 5 | if n == 0: 6 | break 7 | else: 8 | list.append(n) 9 | 10 | list.reverse() 11 | for i in list: 12 | print(i) 13 | -------------------------------------------------------------------------------- /دانشگاهی/سیگماگیر/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | m = int(input()) 3 | sum = 0 4 | 5 | for i in range(-10, m + 1): 6 | 7 | for j in range(1, n + 1): 8 | 9 | sum += int(((i + j) ** 3) / (j**2)) 10 | 11 | print(sum) 12 | -------------------------------------------------------------------------------- /مسابقه/چاپ برعکس/main.py: -------------------------------------------------------------------------------- 1 | s = [] 2 | while True: 3 | n = int(input()) 4 | if n != 0: 5 | s.append(n) 6 | elif n == 0: 7 | for i in range(len(s) - 1, -1, -1): 8 | print(s[i]) 9 | break 10 | -------------------------------------------------------------------------------- /مسابقه/بازگشت از بوستان/main.py: -------------------------------------------------------------------------------- 1 | x, y = input().split(" ") 2 | x1, y1 = input().split(" ") 3 | x = int(x) 4 | y = int(y) 5 | x1 = int(x1) 6 | y1 = int(y1) 7 | 8 | if x1 > x: 9 | print("Right") 10 | elif x1 < x: 11 | print("Left") 12 | -------------------------------------------------------------------------------- /مسابقه/کلید چراغ/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | state1 = int(input()) 3 | sum = 0 4 | 5 | for i in range(n - 1): 6 | state = int(input()) 7 | if state != state1: 8 | sum += 1 9 | state1 = state 10 | 11 | print(sum) 12 | -------------------------------------------------------------------------------- /مسابقه/سوراخ موش/main.py: -------------------------------------------------------------------------------- 1 | x1, x2 = input().split(" ") 2 | x1 = int(x1) 3 | x2 = int(x2) 4 | 5 | if x1 == x2: 6 | print("Saal Noo Mobarak!") 7 | elif x1 < x2: 8 | print((x2 - x1) * "R") 9 | elif x1 > x2: 10 | print((x1 - x2) * "L") 11 | -------------------------------------------------------------------------------- /دانشگاهی/ب.م.م و ک.م.م/main.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | input = input().split(" ") 4 | n = int(input[0]) 5 | m = int(input[1]) 6 | 7 | 8 | def lcm(a, b): 9 | return (a * b) / math.gcd(a, b) 10 | 11 | 12 | print(math.gcd(n, m), int(lcm(n, m))) 13 | -------------------------------------------------------------------------------- /مسابقه/جدول ضرب گنده/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | t = 0 3 | for i in range(1, n + 1): 4 | for j in range(1, n + 1): 5 | print(i * j, "", end="") 6 | t += 1 7 | if t == n: 8 | print("") 9 | t = 0 10 | -------------------------------------------------------------------------------- /مسابقه/همایش زندگی بهتر/main.py: -------------------------------------------------------------------------------- 1 | inp = input().split(" ") 2 | r = int(inp[0]) 3 | c = int(inp[1]) 4 | 5 | # to right 6 | if c <= 10: 7 | print("Right", 10 - r + 1, c) 8 | 9 | # to left 10 | else: 11 | print("Left", 10 - r + 1, 20 - c + 1) 12 | -------------------------------------------------------------------------------- /مسابقه/بهداشت و سلامت/main.py: -------------------------------------------------------------------------------- 1 | x = int(input()) 2 | n = int(input()) 3 | ans = 0 4 | if n == 0: 5 | ans = 20 6 | elif n == 7: 7 | ans = x 8 | else: 9 | ans = x - n 10 | 11 | if ans < 0: 12 | print(0) 13 | else: 14 | print(ans) 15 | -------------------------------------------------------------------------------- /مسابقه/مشق امشب باقر/main.py: -------------------------------------------------------------------------------- 1 | s = input().split(" ") 2 | 3 | if ( 4 | int(s[0]) != 0 5 | and int(s[1]) != 0 6 | and int(s[2]) != 0 7 | and int(s[0]) + int(s[1]) + int(s[2]) == 180 8 | ): 9 | print("Yes") 10 | 11 | else: 12 | print("No") 13 | -------------------------------------------------------------------------------- /مسابقه/نوبرانه/main.py: -------------------------------------------------------------------------------- 1 | inp = input().split() 2 | count = 0 3 | 4 | for i in inp: 5 | if int(i) >= 80: 6 | count += 1 7 | 8 | if count >= 3: 9 | print("Mamma mia!") 10 | elif 0 < count < 3: 11 | print("Mamma mia!!") 12 | else: 13 | print("Mamma mia!!!") 14 | -------------------------------------------------------------------------------- /مسابقه/سوال برنامه نویسی برنامه نویسی سوال/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | s = input().split() 3 | s2 = [None] * n 4 | for i in range(n): 5 | s2[n - 1] = s[i] 6 | n -= 1 7 | 8 | for i in s2: 9 | print(i, end="") 10 | if i != s2[n - 1]: 11 | print(" ", end="") 12 | -------------------------------------------------------------------------------- /تکنولوژی/chesstml/chesstml/chesstml/solution.py: -------------------------------------------------------------------------------- 1 | from bs4 import BeautifulSoup 2 | 3 | 4 | def process(name): 5 | f = open(name, "r") 6 | document = BeautifulSoup(f.read(), "html.parser") 7 | t = document.find_all("a") 8 | # print(document.prettify()) 9 | return len(t) 10 | -------------------------------------------------------------------------------- /تکنولوژی/chesstml/chesstml/chesstml/htmlsampletest2.html: -------------------------------------------------------------------------------- 1 | 2 | Self 3 | Blank 4 | Parent 5 | Top 6 | -------------------------------------------------------------------------------- /مسابقه/رشته فیبوناچی/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | f0 = 0 3 | f1 = 1 4 | i = 1 5 | 6 | while i <= n: 7 | fn = f1 + f0 8 | if i == fn: 9 | print("+", end="") 10 | f0 = f1 11 | f1 = fn 12 | i += 1 13 | else: 14 | print("-", end="") 15 | i += 1 16 | -------------------------------------------------------------------------------- /مسابقه/کم ارزشترین رقم 9 نیست!/main.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | inp = int(input()) 4 | fact = math.factorial(inp) 5 | 6 | 7 | def f(n): 8 | n = str(n) 9 | for i in range(len(n) - 1, -1, -1): 10 | if int(n[i]) != 0: 11 | print(n[i]) 12 | break 13 | 14 | 15 | f(fact) 16 | -------------------------------------------------------------------------------- /دانشگاهی/دنباله‌ی فیبوناچی/main.py: -------------------------------------------------------------------------------- 1 | def ShowFibNth(n0, n1): 2 | print(n0) 3 | 4 | x = n0 5 | n0 = n1 - n0 6 | n1 = x 7 | 8 | if n0 <= 0: 9 | return 0 10 | else: 11 | return ShowFibNth(n0, n1) 12 | 13 | 14 | n0 = int(input()) 15 | n1 = int(input()) 16 | ShowFibNth(n0, n1) 17 | -------------------------------------------------------------------------------- /مسابقه/استخدام در ترب/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | a = input().split(" ") 3 | s = 0 4 | # cnt = 0 5 | 6 | for i in range(0, n): 7 | for j in range(0, n): 8 | if a[i] < a[j]: 9 | continue 10 | f = int(int(a[i]) / int(a[j])) 11 | s += f 12 | # cnt +=1 13 | 14 | print(s) 15 | -------------------------------------------------------------------------------- /مسابقه/یک سوال ساده/main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class main { 4 | public static void main(String args[]) { 5 | Scanner sc = new Scanner(System.in); 6 | int n = sc.nextInt(); 7 | for (int i = 0; i < n; i++) { 8 | System.out.println("man khoshghlab hastam"); 9 | } 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /دانشگاهی/فاکتوریل/main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | public class main { 3 | public static void main(String args[]) { 4 | Scanner s1= new Scanner(System.in); 5 | int n = s1.nextInt(); 6 | int i = 1; 7 | int temp =1; 8 | for(i=1;i<=n;i++) { 9 | temp*=i; 10 | } 11 | System.out.print(temp); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /مسابقه/شارژ موبایل/main.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class main { 4 | public static void main(String args[]) { 5 | Scanner sc = new Scanner(System.in); 6 | int k = sc.nextInt(); 7 | int t=0; 8 | for (int i = 0; i < k; i++) { 9 | t+=i+1; 10 | 11 | } 12 | System.out.print(t); 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /مسابقه/آسمان شکر آباد/main.py: -------------------------------------------------------------------------------- 1 | nm = input().split(" ") 2 | n = int(nm[0]) # tedade satr 3 | m = int(nm[1]) # tedade horuf dar har satr 4 | number = 0 # tedade setare ha 5 | 6 | for i in range(0, n): 7 | aseman = input() 8 | for j in aseman: 9 | if j == "*": 10 | number += 1 11 | 12 | print(number) 13 | -------------------------------------------------------------------------------- /مسابقه/سوال زرد/main.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | public class main { 3 | public static void main(String args[]) { 4 | Scanner sc=new Scanner(System.in); 5 | int n=sc.nextInt(); 6 | System.out.print("W"); 7 | for(int i=0;i b and c > d) or (b > a and d > c): 10 | print("Eyval baba!") 11 | else: 12 | print("Naaa, eshtebahe!") 13 | -------------------------------------------------------------------------------- /مسابقه/اسم‌ها/main.py: -------------------------------------------------------------------------------- 1 | def getnumber(string): 2 | list = [] 3 | for i in string: 4 | if i not in list: 5 | list.append(i) 6 | return len(list) 7 | 8 | 9 | n = int(input()) 10 | max = 0 11 | for i in range(n): 12 | s = input() 13 | if getnumber(s) > max: 14 | max = getnumber(s) 15 | 16 | print(max) 17 | -------------------------------------------------------------------------------- /مسابقه/روز آزادی بیان در برره/main.py: -------------------------------------------------------------------------------- 1 | bb = 0 2 | pb = 0 3 | k = int(input()) 4 | 5 | while True: 6 | bb = pb + 1 7 | pb = bb + 1 8 | # print("bb: ", bb) 9 | # print("pb: ", pb) 10 | 11 | if bb == k: 12 | print("Payin Barare") 13 | break 14 | if pb == k: 15 | print("Bala Barare") 16 | break 17 | -------------------------------------------------------------------------------- /دانشگاهی/چاپ لوزی/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) # tedade space 2 | s = 1 # tedade setare ha 3 | 4 | while n >= 0: 5 | l = " " * n + "*" * s 6 | print(l) 7 | n -= 1 8 | s += 2 9 | else: 10 | n += 1 11 | s -= 2 12 | while s > 1: 13 | n += 1 14 | s -= 2 15 | l = " " * n + "*" * s 16 | print(l) 17 | -------------------------------------------------------------------------------- /تکنولوژی/chesstml/chesstml/chesstml/testssample.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from bs4 import BeautifulSoup 4 | from solution import process 5 | 6 | 7 | class Test(unittest.TestCase): 8 | def test_1(self): 9 | self.assertEqual(process("htmlsampletest1.html"), 1) 10 | 11 | def test_2(self): 12 | self.assertEqual(process("htmlsampletest2.html"), 4) 13 | -------------------------------------------------------------------------------- /مسابقه/پرگوشت/main.py: -------------------------------------------------------------------------------- 1 | n, m = input().split(" ") 2 | n = int(n) 3 | m = int(m) 4 | 5 | count1 = 0 6 | count2 = 0 7 | 8 | for i in range(2 * n): 9 | inp = input() 10 | for j in inp: 11 | if j == "*" and i < n: 12 | count1 += 1 13 | elif j == "*" and i >= n: 14 | count2 += 1 15 | 16 | print(count1, count2) 17 | -------------------------------------------------------------------------------- /مسابقه/یخدارچی/main.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class main { 4 | public static void main(String args[]) { 5 | Scanner sc = new Scanner(System.in); 6 | int T = sc.nextInt(); 7 | if (T < 0) { 8 | System.out.print("Ice"); 9 | } else if (T > 100) { 10 | System.out.print("Steam"); 11 | } else 12 | System.out.print("Water"); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /دانشگاهی/تاریخ تولد/main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | public class main { 3 | public static void main(String args[]) { 4 | 5 | Scanner sc = new Scanner(System.in); 6 | String tarikh=sc.nextLine(); 7 | System.out.println("saal:"+tarikh.charAt(0)+ tarikh.charAt(1)); 8 | System.out.println("maah:"+tarikh.charAt(2)+ tarikh.charAt(3)); 9 | 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /مسابقه/باب و کلید تلویزیون/main.py: -------------------------------------------------------------------------------- 1 | n = input().split(" ") 2 | number = int(n[0]) 3 | x = int(n[1]) 4 | k = int(n[2]) 5 | kanal = [None] * number 6 | 7 | for i in range(number): 8 | kanal[i] = input() 9 | 10 | for i in range(k): 11 | if x < number: 12 | x += 1 13 | elif x == number: 14 | x = 0 15 | x += 1 16 | 17 | print(kanal[x - 1]) 18 | -------------------------------------------------------------------------------- /مسابقه/صفحه‌کلید انتخاباتی/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | string = "" 3 | caps = -1 # CapsLock off 4 | 5 | for i in range(n): 6 | inp = input() 7 | if inp == "CAPS": 8 | caps = -caps 9 | inp = "" 10 | 11 | if caps == 1: # CapsLock on 12 | string += inp.upper() 13 | elif caps == -1: 14 | string += inp 15 | 16 | print(string) 17 | -------------------------------------------------------------------------------- /دانشگاهی/اعداد فیثاغورثی/main.py: -------------------------------------------------------------------------------- 1 | n1 = int(input()) 2 | n2 = int(input()) 3 | n3 = int(input()) 4 | a = 0 5 | b = 0 6 | c = n1 7 | 8 | if n2 > c: 9 | c = n2 10 | b = n1 11 | else: 12 | b = n2 13 | 14 | if n3 > c: 15 | c = n3 16 | a = n1 17 | else: 18 | a = n3 19 | 20 | if a * a + b * b == c * c: 21 | print("YES") 22 | else: 23 | print("NO") 24 | -------------------------------------------------------------------------------- /مسابقه/استخدام در ترب/main2.py: -------------------------------------------------------------------------------- 1 | inp = input().split(" ") 2 | n = int(inp[0]) 3 | q = int(inp[1]) 4 | 5 | ci = input().split(" ") 6 | 7 | sum = 0 8 | list = [] 9 | for i in range(0, q): 10 | list.append(int(input())) 11 | 12 | 13 | for j in list: 14 | for i in range(0, n): 15 | if int(ci[i]) < j: 16 | sum += 1 17 | print(sum) 18 | sum = 0 19 | -------------------------------------------------------------------------------- /مسابقه/رژیم سخت/main.py: -------------------------------------------------------------------------------- 1 | barchasb = input() 2 | red = 0 3 | green = 0 4 | yellow = 0 5 | 6 | for i in barchasb: 7 | if i == "R": 8 | red += 1 9 | elif i == "Y": 10 | yellow += 1 11 | elif i == "G": 12 | green += 1 13 | 14 | if red == 3 or green == 0 or (red == 2 and yellow == 2): 15 | print("nakhor lite") 16 | else: 17 | print("rahat baash") 18 | -------------------------------------------------------------------------------- /دانشگاهی/لوزی‌های ستاره‌ای/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) # tedade space 2 | s = 1 # tedade setare ha 3 | n = int(n / 2) 4 | while n >= 0: 5 | l = " " * n + "*" * s + " " * n 6 | print(l * 2) 7 | n -= 1 8 | s += 2 9 | else: 10 | n += 1 11 | s -= 2 12 | while s > 1: 13 | n += 1 14 | s -= 2 15 | l = " " * n + "*" * s + " " * n 16 | print(l * 2) 17 | -------------------------------------------------------------------------------- /مسابقه/آخ جون طرف نیست!/main.py: -------------------------------------------------------------------------------- 1 | n1 = int(input()) 2 | days1 = input().split() 3 | 4 | n2 = int(input()) 5 | days2 = input().split() 6 | 7 | n3 = int(input()) 8 | days3 = input().split() 9 | 10 | week = ["shanbe", "1shanbe", "2shanbe", "3shanbe", "4shanbe", "5shanbe", "jome"] 11 | 12 | for i in days1 + days2 + days3: 13 | if i in week: 14 | week.remove(i) 15 | 16 | print(len(week)) 17 | -------------------------------------------------------------------------------- /مسابقه/تو چقدر اضافه وزن داری؟/main.py: -------------------------------------------------------------------------------- 1 | # nesbate BMI 2 | 3 | n = int(input()) # vazn kg 4 | m = float(input()) # ghad metr 5 | 6 | bmi = n / (m * m) 7 | 8 | print("%.2f" % bmi) 9 | 10 | if bmi < 18.5: 11 | print("Underweight") 12 | elif 18.5 <= bmi and bmi < 25: 13 | print("Normal") 14 | elif 25 <= bmi and bmi < 30: 15 | print("Overweight") 16 | elif bmi >= 30: 17 | print("Obese") 18 | -------------------------------------------------------------------------------- /مسابقه/بتایپ!!!!!!!!!!!!!/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | sys.setrecursionlimit(10**6) 4 | inp = input() 5 | cnt = inp.count("=") 6 | 7 | if cnt == 0: 8 | print(inp) 9 | else: 10 | for i in range(cnt): 11 | if len(inp) >= 2: 12 | position = inp.find("=") 13 | 14 | if position != -1: 15 | inp = inp[0 : position - 1] + inp[position + 1 :] 16 | 17 | print(inp) 18 | -------------------------------------------------------------------------------- /دانشگاهی/ماکزیمم/main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | public class main { 3 | public static void main(String args[]) { 4 | Scanner s1=new Scanner(System.in); 5 | 6 | int i,temp = 0; 7 | int n=s1.nextInt(); 8 | for(i=0;itemp || m==temp) { 12 | temp=m; 13 | } 14 | } 15 | 16 | System.out.println(temp); 17 | 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /دانشگاهی/مثلث خیام/main.py: -------------------------------------------------------------------------------- 1 | def printPascal(n): 2 | 3 | for line in range(1, n + 1): 4 | C = 1 5 | # used to represent C(line, i) 6 | for i in range(1, line + 1): 7 | 8 | # The first value in a 9 | # line is always 1 10 | print(C, end=" ") 11 | C = int(C * (line - i) / i) 12 | print("") 13 | 14 | 15 | n = int(input()) 16 | printPascal(n) 17 | -------------------------------------------------------------------------------- /دانشگاهی/کامل بودن یا نبودن/main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | public class main { 3 | public static void main(String args[]) { 4 | Scanner sc = new Scanner(System.in); 5 | int n=sc.nextInt(); 6 | int i,sum=0; 7 | for(i=1;in) { 11 | System.out.println(tavan); 12 | break; 13 | } 14 | else i++; 15 | 16 | 17 | } 18 | return; 19 | } 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /مسابقه/خر در چمن فراوونه!!/main.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class main { 4 | public static void main(String args[]) { 5 | Scanner sc = new Scanner(System.in); 6 | int a = sc.nextInt(); 7 | int b = sc.nextInt(); 8 | int l = sc.nextInt(); 9 | int sum = 0; 10 | for (int i = 0; i < l; i++) { 11 | if (i % 2 == 0) { 12 | sum += a; 13 | } else 14 | sum += b; 15 | } 16 | System.out.print(sum); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /مسابقه/تک رقمی/main.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | 4 | def f(n, sum): 5 | while n >= 10: 6 | temp = n % 10 7 | n = n / 10 8 | n = int(n) 9 | sum += temp 10 | if n < 10: 11 | sum += n 12 | if sum < 10: 13 | print(sum) 14 | else: 15 | f(sum, 0) 16 | 17 | 18 | n = int(input()) 19 | if n >= 10 and n <= math.pow(10, 18): 20 | f(n, 0) 21 | elif n >= 1 and n < 10: 22 | print(n) 23 | -------------------------------------------------------------------------------- /مسابقه/سطح مکعب/main.py: -------------------------------------------------------------------------------- 1 | v = int(input()) 2 | maghsum = [] 3 | s = [] 4 | for i in range(1, v + 1): 5 | if v % i == 0: 6 | maghsum.append(i) 7 | 8 | for a in maghsum: 9 | for b in maghsum: 10 | for c in maghsum: 11 | if a * b * c == v: 12 | m = 2 * a * b + 2 * b * c + 2 * a * c 13 | s.append(m) 14 | 15 | min = s[0] 16 | for i in s: 17 | if i < min: 18 | min = i 19 | print(min) 20 | -------------------------------------------------------------------------------- /تکنولوژی/ثبت‌نام/source.py: -------------------------------------------------------------------------------- 1 | def check_registration_rules(**userpass): 2 | 3 | for i in list(userpass): 4 | if ( 5 | i == "quera" 6 | or i == "codecup" 7 | or len(i) < 4 8 | or len(userpass[i]) < 6 9 | or userpass[i].isnumeric() == True 10 | ): 11 | userpass.pop(i) 12 | 13 | return list(userpass) 14 | 15 | 16 | # check_registration_rules(saeed='1234567', ab='afj$L12') 17 | -------------------------------------------------------------------------------- /مسابقه/در جستجوی ترب/main.py: -------------------------------------------------------------------------------- 1 | x1 = int(input()) 2 | v1 = int(input()) 3 | x2 = int(input()) 4 | v2 = int(input()) 5 | 6 | if x2 > x1 and v2 > v1: 7 | print("BORO BORO") 8 | if x2 < x1 and v2 < v1: 9 | print("BORO BORO") 10 | 11 | if x2 > x1 and v2 == v1: 12 | print("WAIT WAIT") 13 | if x2 < x1 and v2 == v1: 14 | print("WAIT WAIT") 15 | 16 | if x2 > x1 and v2 < v1: 17 | print("SEE YOU") 18 | if x2 < x1 and v2 > v1: 19 | print("SEE YOU") 20 | -------------------------------------------------------------------------------- /مسابقه/مجید، میلاد، رشته‌سازی/main.py: -------------------------------------------------------------------------------- 1 | # Returns '0' for '1' and '1' for '0' 2 | def flip(c): 3 | return "1" if (c == "0") else "0" 4 | 5 | 6 | def One_Complement(bin): 7 | 8 | n = len(bin) 9 | ones = "" 10 | 11 | for i in range(n): 12 | ones += flip(bin[i]) 13 | 14 | return ones 15 | 16 | 17 | l, r = input().split(" ") 18 | b = "1" 19 | for i in range(17): 20 | b += One_Complement(b) 21 | 22 | print(b[int(l) - 1 : int(r)]) 23 | -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/Challenge/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for Challenge project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Challenge.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /تکنولوژی/عکس تار/quera.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /مسابقه/دایره عجیب/main.py: -------------------------------------------------------------------------------- 1 | n, k = input().split(" ") 2 | n, k = int(n), int(k) 3 | 4 | s = [] 5 | for i in range(1, n + 1): 6 | s.append(i) 7 | 8 | i = 0 9 | rounds = 0 10 | while True: 11 | i += k 12 | rounds += 1 13 | 14 | if i <= n - 1: 15 | if s[i] == 1: 16 | # print(i) 17 | break 18 | 19 | elif i > n - 1: 20 | i = i - (n) 21 | if s[i] == 1: 22 | break 23 | 24 | print(rounds) 25 | -------------------------------------------------------------------------------- /مسابقه/وسط صندلی عقب/main.py: -------------------------------------------------------------------------------- 1 | import collections 2 | 3 | de = collections.deque() 4 | 5 | mosafer1 = input().split(" ") 6 | mosafer2 = input().split(" ") 7 | mosafer3 = input().split(" ") 8 | mosafer4 = input().split(" ") 9 | 10 | mosafers = [mosafer1, mosafer2, mosafer3, mosafer4] 11 | 12 | for i in mosafers: 13 | 14 | if i[1] == "R": 15 | de.append(i[0]) 16 | 17 | elif i[1] == "L": 18 | de.appendleft(i[0]) 19 | 20 | 21 | print(de[1]) 22 | -------------------------------------------------------------------------------- /مسابقه/دو نقطه خط/main.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class main { 4 | public static void main(String args[]) { 5 | Scanner sc = new Scanner(System.in); 6 | int x1 = sc.nextInt(); 7 | int y1 = sc.nextInt(); 8 | int x2 = sc.nextInt(); 9 | int y2 = sc.nextInt(); 10 | if (y1 == y2) 11 | System.out.print("Horizontal"); 12 | else if (x1 == x2) 13 | System.out.print("Vertical"); 14 | else 15 | System.out.print("Try again"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /دانشگاهی/اول‌بینی/main.py: -------------------------------------------------------------------------------- 1 | def checkprime(num): 2 | t = 1 3 | for i in range(2, num): 4 | if (num % i) == 0: 5 | t = 0 6 | break 7 | return t 8 | 9 | 10 | a = int(input()) 11 | b = int(input()) 12 | list = [] 13 | for i in range(a + 1, b): 14 | if checkprime(i) == 1: 15 | list.append(i) 16 | 17 | for i in list: 18 | print(i, end="") 19 | if i == list[len(list) - 1]: 20 | break 21 | print(",", end="") 22 | -------------------------------------------------------------------------------- /مسابقه/صدگان خسته/main.py: -------------------------------------------------------------------------------- 1 | n = input() 2 | m = input() 3 | 4 | if int(n[2]) < int(m[2]): 5 | print(n, "<", m) 6 | 7 | elif int(n[2]) > int(m[2]): 8 | print(m, "<", n) 9 | 10 | elif int(n[1]) < int(m[1]): 11 | print(n, "<", m) 12 | 13 | elif int(n[1]) > int(m[1]): 14 | print(m, "<", n) 15 | 16 | elif int(n[0]) < int(m[0]): 17 | print(n, "<", m) 18 | 19 | elif int(n[0]) > int(m[0]): 20 | print(m, "<", n) 21 | 22 | else: 23 | print(n, "=", m) 24 | -------------------------------------------------------------------------------- /دانشگاهی/یافتن عدد اول/main.py: -------------------------------------------------------------------------------- 1 | n = input() 2 | 3 | # b = sum of digits of input 4 | b = 0 5 | 6 | for i in n: 7 | b += int(i) 8 | 9 | 10 | # checkprime function 11 | def checkprime(num): 12 | t = 1 13 | for i in range(2, num): 14 | if (num % i) == 0: 15 | t = 0 16 | break 17 | return t 18 | 19 | 20 | i = 0 21 | n = int(n) 22 | while i < b: 23 | n += 1 24 | if checkprime(n) == 1: 25 | i += 1 26 | 27 | print(n) 28 | -------------------------------------------------------------------------------- /تکنولوژی/عکس تار/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Blur image 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /دانشگاهی/فرزاد فیلم‌بین/main.py: -------------------------------------------------------------------------------- 1 | def moratab(s): 2 | string = s.split() 3 | j = 0 4 | for i in string: 5 | string[j] = i[0].upper() + i[1:].lower() 6 | print(string[j], end="") 7 | j += 1 8 | if j < len(string): 9 | print(" ", end="") 10 | 11 | 12 | list = [] 13 | n = int(input()) 14 | for i in range(n): 15 | s = input() 16 | list.append(s) 17 | 18 | for i in list: 19 | moratab(i) 20 | if i != list[len(list) - 1]: 21 | print("") 22 | -------------------------------------------------------------------------------- /مسابقه/آزمون تستی/main.py: -------------------------------------------------------------------------------- 1 | key_map = {"A": "#OOO", "B": "O#OO", "C": "OO#O", "D": "OOO#"} 2 | questions_counts = int(input()) 3 | key = input() 4 | page_counts = int(input()) 5 | 6 | 7 | for page in range(page_counts): 8 | t = 0 9 | f = 0 10 | ignored = 0 11 | 12 | for question in range(questions_counts): 13 | student_answer = input() 14 | correct_answer = key_map[key[question]] 15 | 16 | if student_answer == correct_answer: 17 | t += 1 18 | elif student_answer == "OOOO": 19 | ignored += 1 20 | else: 21 | f += 1 22 | 23 | print(t * 3 - f) 24 | -------------------------------------------------------------------------------- /دانشگاهی/اعداد فیثاغورثی/main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | public class fisaghores { 3 | public static void main(String args[]) { 4 | Scanner sc = new Scanner(System.in); 5 | int n1= sc.nextInt(); 6 | int n2= sc.nextInt(); 7 | int n3= sc.nextInt(); 8 | int a = 0 ,b = 0; 9 | int c=n1; 10 | if(n2>c) { 11 | c=n2; 12 | b=n1;} 13 | else b=n2; 14 | 15 | if(n3>c) { 16 | c=n3; 17 | a=n1; 18 | } 19 | else a=n3; 20 | 21 | 22 | if(a*a + b*b == c*c) { 23 | 24 | System.out.println("YES"); 25 | } 26 | 27 | else System.out.println("NO"); 28 | 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /دانشگاهی/چاپ مربع/main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | public class main { 3 | public static void main(String args[]) { 4 | 5 | Scanner sc= new Scanner(System.in); 6 | int n= sc.nextInt(); 7 | int i=0; 8 | int j=0; 9 | int h=0; 10 | int g=0; 11 | for(i=0;i 2 | 3 | 4 | 5 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/blog/migrations/0002_alter_comment_blog_post.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.0.4 on 2023-01-07 15:44 2 | 3 | import django.db.models.deletion 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ("blog", "0001_initial"), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name="comment", 16 | name="blog_post", 17 | field=models.ForeignKey( 18 | on_delete=django.db.models.deletion.CASCADE, 19 | related_name="comments", 20 | to="blog.blogpost", 21 | ), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /دانشگاهی/کار با اعداد اعشاری/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | list = [] 3 | sum = 0 # hasele jame adad ha 4 | 5 | for i in range(0, n): 6 | k = float(input()) 7 | list.append(k) 8 | sum += k 9 | 10 | list.sort() 11 | avg = sum / n 12 | 13 | 14 | # baraie vaghti k tedad ashar bishtar az 3ta bashe auto round ro control mikone ta asharo daghigh b dast biare! 15 | def func(i): 16 | n = len(str(i).split(".")[1]) 17 | if n >= 3: 18 | return int(i * 10**3) / 10**3 19 | 20 | else: 21 | return i 22 | 23 | 24 | print("Max: %.3f" % func(list[n - 1])) # max 25 | print("Min: %.3f" % func(list[0])) # min 26 | print("Avg: %.3f" % func(avg)) # avg 27 | -------------------------------------------------------------------------------- /مسابقه/بازی یک، سه، پنچ/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | if n == 0: 4 | print("No") 5 | print("No") 6 | print("No") 7 | elif n == 6: 8 | print("Yes") 9 | print("No") 10 | print("Yes") 11 | elif n == 1: 12 | print("Yes") 13 | print("No") 14 | print("No") 15 | elif n == 4: 16 | print("Yes") 17 | print("Yes") 18 | print("No") 19 | elif n == 3: 20 | print("No") 21 | print("Yes") 22 | print("No") 23 | elif n == 5: 24 | print("No") 25 | print("No") 26 | print("Yes") 27 | elif n == 8: 28 | print("No") 29 | print("Yes") 30 | print("Yes") 31 | elif n == 9: 32 | print("Yes") 33 | print("Yes") 34 | print("Yes") 35 | -------------------------------------------------------------------------------- /دانشگاهی/اعداد اول/prime.java: -------------------------------------------------------------------------------- 1 | 2 | import java.util.Scanner; 3 | 4 | public class prime { 5 | public static void prime(int n) { 6 | int i, f = 0; 7 | 8 | if (n == 0 || n == 1) { 9 | 10 | } else { 11 | for (i = 2; i < n; i++) { 12 | 13 | if (n % i == 0) { 14 | 15 | f = 1; 16 | break; 17 | } 18 | } 19 | if (f == 0) { 20 | System.out.println(n); 21 | 22 | } 23 | } 24 | } 25 | 26 | public static void main(String args[]) { 27 | 28 | Scanner a = new Scanner(System.in); 29 | int n1 = a.nextInt(); 30 | int n2 = a.nextInt(); 31 | for (int n = n1; n <= n2; n++) { 32 | prime(n); 33 | 34 | } 35 | } 36 | }// 2 adad gerfte va adad haie avale beineshan ra chap mikonad. -------------------------------------------------------------------------------- /مسابقه/شماره رند/main.py: -------------------------------------------------------------------------------- 1 | t = int(input()) 2 | lst = [] 3 | 4 | for i in range(t): 5 | lst.append(input()) 6 | 7 | 8 | def f1(x): 9 | 10 | for i in range(10): 11 | 12 | count = 0 13 | for j in x: 14 | if j == str(i): 15 | count = count + 1 16 | if count >= 4: 17 | return True 18 | 19 | 20 | def f2(x): 21 | for i in range(10): 22 | if x.count(3 * str(i)) >= 1: 23 | return True 24 | 25 | 26 | def f3(x): 27 | if x == x[::-1]: 28 | return True 29 | 30 | 31 | for i in lst: 32 | if f1(i) == True or f2(i) == True or f3(i) == True: 33 | print("Ronde!") 34 | else: 35 | print("Rond Nist") 36 | -------------------------------------------------------------------------------- /مسابقه/ام سین/main.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class main { 4 | 5 | public static void main(String args[]) { 6 | Scanner sc = new Scanner(System.in); 7 | int m = sc.nextInt(); 8 | switch (m) { 9 | case 1: 10 | System.out.println("samanoo"); 11 | case 2: 12 | System.out.println("samanoo\nsib"); 13 | case 3: 14 | System.out.println("samanoo\nsib\nserke"); 15 | case 4: 16 | System.out.println("samanoo\nsib\nserke\nseke"); 17 | case 5: 18 | System.out.println("samanoo\nsib\nserke\nseke\nsir"); 19 | case 6: 20 | System.out.println("samanoo\nsib\nserke\nseke\nsir\nsomagh"); 21 | case 7: 22 | System.out.println("samanoo\nsib\nserke\nseke\nsir\nsomagh\nsenjed"); 23 | 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /دانشگاهی/عدد چاپ کن/main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | public class main { 3 | public static void main(String args[]) { 4 | Scanner a=new Scanner(System.in); 5 | int n=a.nextInt(),tul=0; 6 | int m=n; 7 | int i,j,h; 8 | while(0=0 && tul<100) { 15 | for(i=m;i>0;i=i/10){ 16 | int g=0; 17 | Array[tul-1]=i%10; 18 | tul--; 19 | } 20 | for(j=0;j n - k: 29 | k = n - k 30 | for i in range(0, k): 31 | res = res * (n - i) 32 | res = res // (i + 1) 33 | 34 | return res 35 | 36 | 37 | # Driver program 38 | n = int(input()) 39 | printPascal(n) 40 | 41 | 42 | # This code is contributed by Nikita Tiwari. 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Alireza Ghorbani 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /مسابقه/پاکسازی/main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | s = input() 3 | path = input().split(" ") 4 | path[0] = int(path[0]) 5 | path[1] = int(path[1]) 6 | 7 | if path[0] == path[1]: 8 | print(0) 9 | 10 | else: 11 | 12 | def func(zurgir, count): 13 | for i in range(10): 14 | if pow(2, i) == zurgir: 15 | count += 1 16 | return count 17 | 18 | elif pow(2, i) > zurgir: 19 | zurgir -= pow(2, i - 1) 20 | count += 1 21 | return func(zurgir, count) 22 | 23 | zurgir = 0 24 | ls = list() 25 | if path[1] > path[0]: 26 | for i in s[path[0] - 1 : path[1]]: 27 | if i == "H": 28 | zurgir += 1 29 | elif zurgir != 0: 30 | ls.append(zurgir) 31 | zurgir = 0 32 | 33 | else: 34 | for i in s[path[1] - 1 : path[0]]: 35 | if i == "H": 36 | zurgir += 1 37 | elif zurgir != 0: 38 | ls.append(zurgir) 39 | zurgir = 0 40 | 41 | # print(ls) 42 | ans = 0 43 | for i in ls: 44 | ans += func(i, 0) 45 | 46 | print(ans) 47 | -------------------------------------------------------------------------------- /دانشگاهی/جمع اعداد/main.py: -------------------------------------------------------------------------------- 1 | # Python3 program to find sum of 2 | # two large numbers. 3 | 4 | 5 | # Function for finding sum of 6 | # larger numbers 7 | def findSum(str1, str2): 8 | 9 | # Before proceeding further, 10 | # make sure length of str2 is larger. 11 | if len(str1) > len(str2): 12 | t = str1 13 | str1 = str2 14 | str2 = t 15 | 16 | # Take an empty string for 17 | # storing result 18 | str = "" 19 | 20 | # Calculate length of both string 21 | n1 = len(str1) 22 | n2 = len(str2) 23 | 24 | # Reverse both of strings 25 | str1 = str1[::-1] 26 | str2 = str2[::-1] 27 | 28 | carry = 0 29 | for i in range(n1): 30 | 31 | # Do school mathematics, compute 32 | # sum of current digits and carry 33 | sum = (ord(str1[i]) - 48) + ((ord(str2[i]) - 48) + carry) 34 | str += chr(sum % 10 + 48) 35 | 36 | # Calculate carry for next step 37 | carry = int(sum / 10) 38 | 39 | # Add remaining digits of larger number 40 | for i in range(n1, n2): 41 | sum = (ord(str2[i]) - 48) + carry 42 | str += chr(sum % 10 + 48) 43 | carry = (int)(sum / 10) 44 | 45 | # Add remaining carry 46 | if carry: 47 | str += chr(carry + 48) 48 | 49 | # reverse resultant string 50 | str = str[::-1] 51 | 52 | return str 53 | 54 | 55 | n = int(input()) 56 | sum = "0" 57 | for i in range(0, n): 58 | sum = findSum(input(), sum) 59 | print(sum) 60 | -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/tests/testsample.py: -------------------------------------------------------------------------------- 1 | from datetime import timedelta 2 | 3 | from blog.models import * 4 | from django.test import TestCase 5 | from django.utils import timezone 6 | from django.utils.timezone import datetime 7 | 8 | 9 | class SampleTest(TestCase): 10 | def test_1_create_author(self): 11 | Author.objects.create(name="meysam1") 12 | self.assertEqual(Author.objects.count(), 1) 13 | self.assertEqual(Author.objects.get(id=1).name, "meysam1") 14 | 15 | def test_2_create_blog_post(self): 16 | a1 = Author.objects.create(name="meysam1") 17 | dt = datetime.now(timezone.utc) 18 | BlogPost.objects.create(author=a1, title="t1", body="b1") 19 | self.assertEqual(BlogPost.objects.count(), 1) 20 | self.assertEqual(BlogPost.objects.get(id=1).author, a1) 21 | self.assertEqual(BlogPost.objects.get(id=1).title, "t1") 22 | self.assertEqual(BlogPost.objects.get(id=1).body, "b1") 23 | self.assertLessEqual( 24 | BlogPost.objects.get(id=1).date_created - dt, timedelta(seconds=3) 25 | ) 26 | 27 | def test_3_create_comment(self): 28 | a1 = Author.objects.create(name="meysam1") 29 | p1 = BlogPost.objects.create(author=a1, title="t1", body="b1") 30 | p2 = BlogPost.objects.create(author=a1, title="t2", body="b2") 31 | self.assertEqual(BlogPost.objects.count(), 2) 32 | Comment.objects.create(blog_post=p1, text="commenttt") 33 | Comment.objects.create(blog_post=p1, text="commenttt") 34 | Comment.objects.create(blog_post=p2, text="commenttt") 35 | Comment.objects.create(blog_post=p2, text="commenttt") 36 | self.assertEqual(Comment.objects.count(), 4) 37 | self.assertEqual(Comment.objects.get(id=1).text, "commenttt") 38 | self.assertEqual(Comment.objects.get(id=1).blog_post, p1) 39 | self.assertEqual(Comment.objects.get(id=2).text, "commenttt") 40 | self.assertEqual(Comment.objects.get(id=2).blog_post, p1) 41 | -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/blog/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.0.4 on 2023-01-07 13:40 2 | 3 | import django.db.models.deletion 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | initial = True 10 | 11 | dependencies = [] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name="Author", 16 | fields=[ 17 | ( 18 | "id", 19 | models.AutoField( 20 | auto_created=True, 21 | primary_key=True, 22 | serialize=False, 23 | verbose_name="ID", 24 | ), 25 | ), 26 | ("name", models.CharField(max_length=50)), 27 | ], 28 | ), 29 | migrations.CreateModel( 30 | name="BlogPost", 31 | fields=[ 32 | ( 33 | "id", 34 | models.AutoField( 35 | auto_created=True, 36 | primary_key=True, 37 | serialize=False, 38 | verbose_name="ID", 39 | ), 40 | ), 41 | ("title", models.CharField(max_length=250)), 42 | ("body", models.TextField()), 43 | ("date_created", models.DateTimeField(auto_now_add=True)), 44 | ( 45 | "author", 46 | models.ForeignKey( 47 | on_delete=django.db.models.deletion.CASCADE, to="blog.author" 48 | ), 49 | ), 50 | ], 51 | ), 52 | migrations.CreateModel( 53 | name="Comment", 54 | fields=[ 55 | ( 56 | "id", 57 | models.AutoField( 58 | auto_created=True, 59 | primary_key=True, 60 | serialize=False, 61 | verbose_name="ID", 62 | ), 63 | ), 64 | ("text", models.TextField(max_length=500)), 65 | ( 66 | "blog_post", 67 | models.ForeignKey( 68 | on_delete=django.db.models.deletion.CASCADE, to="blog.blogpost" 69 | ), 70 | ), 71 | ], 72 | ), 73 | ] 74 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | 131 | # vscode 132 | .vscode/ 133 | 134 | # Ignore OS-specific files (macOS) 135 | .DS_Store 136 | .AppleDouble 137 | .LSOverride -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # پاسخ سوالات سایت کوئرا ![کوئرا](https://user-images.githubusercontent.com/49264993/137637114-e0687e95-08eb-4181-98b0-56fe515f6bc7.png) 4 | 5 | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) 6 | [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/) 7 | 8 | به نظرم حل سوال‌های کوئرا می‌تونه راه خوبی برای شروع برنامه‌نویسی باشه تا دستتون روون بشه. سعی می‌کنم همونطور که خودم پیش می‌رم و هر سوالی رو حل می‌کنم، پاسخ رو اینجا قرار بدم. 9 | 10 | امیدوارم به کارتون بیاد و یادتون نره که هدف، یادگیری هست :) 11 | 12 | ## ریپازیتوری‌های مشابه 13 | 14 | ریپازیتوری‌هایی که کار مشابه انجام داده‌اند رو در زیر اضافه کردم. اگر به دنبال پاسخ سوالات به زبان‌های دیگه هستید یا دوست دارید راه‌حل‌های مختلف رو بررسی کنید، می‌تونید از این ریپازیتوری‌ها استفاده کنید: 15 | 16 | - [AMK9978 solutions](https://github.com/AMK9978/ProgrammingProblems/tree/master/%D9%BE%D8%A7%D8%B3%D8%AE%20%D8%B3%D9%88%D8%A7%D9%84%D8%A7%D8%AA%20%DA%A9%D9%88%D8%A6%D8%B1%D8%A7) 17 | - [bestmahdi2 solutions](https://github.com/bestmahdi2/QueraSolutions) 18 | - [modos solutions](https://github.com/modos/quera-answers) 19 | - [MohammadNPak solutions](https://github.com/MohammadNPak/quera.ir) 20 | - [myp79 solutions](https://github.com/myp79/Quera-Problem-Solution) 21 | 22 | ## مشارکت 23 | 24 | از هر گونه مشارکتی استقبال میشه! کافیه pull request یا issue ایجاد کنید. 25 | 26 |
27 | 28 |
29 | 30 |
31 | 32 | # Solutions to Challenges on Quera ![Quera](https://user-images.githubusercontent.com/49264993/137637114-e0687e95-08eb-4181-98b0-56fe515f6bc7.png) 33 | 34 | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) 35 | [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/) 36 | 37 | Solving Quera questions is a great way to get started with programming and improve your problem-solving skills. As I go along and solve each problem, I'll be adding the solution here. 38 | 39 | I hope this helps, and don't forget, the goal is to learn :) 40 | 41 | ## Similar Repositories 42 | 43 | Here are some repositories that do similar work. If you're looking for solutions in different languages or want to explore various approaches, these might be useful: 44 | 45 | - [AMK9978 solutions](https://github.com/AMK9978/ProgrammingProblems/tree/master/%D9%BE%D8%A7%D8%B3%D8%AE%20%D8%B3%D9%88%D8%A7%D9%84%D8%A7%D8%AA%20%DA%A9%D9%88%D8%A6%D8%B1%D8%A7) 46 | - [bestmahdi2 solutions](https://github.com/bestmahdi2/QueraSolutions) 47 | - [modos solutions](https://github.com/modos/quera-answers) 48 | - [MohammadNPak solutions](https://github.com/MohammadNPak/quera.ir) 49 | - [myp79 solutions](https://github.com/myp79/Quera-Problem-Solution) 50 | 51 | ## Contributing 52 | 53 | Contributions are welcome! Feel free to open issues or submit pull requests. 54 | 55 |
56 | 57 | ### Switch Language 58 | 59 | - [Switch to English](#english) 60 | - [تغییر زبان به فارسی](#persian) 61 | -------------------------------------------------------------------------------- /تکنولوژی/بلاگ/Challenge/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for Challenge project. 3 | 4 | Generated by 'django-admin startproject' using Django 1.11.5. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.11/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/1.11/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = "g1yl-+(jvf==$z2umz!nx)ez5b_!f4%is&u%jthozjv)z3+1u5" 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | "django.contrib.admin", 35 | "django.contrib.auth", 36 | "django.contrib.contenttypes", 37 | "django.contrib.sessions", 38 | "django.contrib.messages", 39 | "django.contrib.staticfiles", 40 | "blog.apps.BlogConfig", 41 | ] 42 | 43 | MIDDLEWARE = [ 44 | "django.middleware.security.SecurityMiddleware", 45 | "django.contrib.sessions.middleware.SessionMiddleware", 46 | "django.middleware.common.CommonMiddleware", 47 | "django.middleware.csrf.CsrfViewMiddleware", 48 | "django.contrib.auth.middleware.AuthenticationMiddleware", 49 | "django.contrib.messages.middleware.MessageMiddleware", 50 | "django.middleware.clickjacking.XFrameOptionsMiddleware", 51 | ] 52 | 53 | ROOT_URLCONF = "Challenge.urls" 54 | 55 | TEMPLATES = [ 56 | { 57 | "BACKEND": "django.template.backends.django.DjangoTemplates", 58 | "DIRS": [], 59 | "APP_DIRS": True, 60 | "OPTIONS": { 61 | "context_processors": [ 62 | "django.template.context_processors.debug", 63 | "django.template.context_processors.request", 64 | "django.contrib.auth.context_processors.auth", 65 | "django.contrib.messages.context_processors.messages", 66 | ], 67 | }, 68 | }, 69 | ] 70 | 71 | WSGI_APPLICATION = "Challenge.wsgi.application" 72 | 73 | 74 | # Database 75 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases 76 | 77 | DATABASES = { 78 | "default": { 79 | "ENGINE": "django.db.backends.sqlite3", 80 | "NAME": os.path.join(BASE_DIR, "db.sqlite3"), 81 | } 82 | } 83 | 84 | 85 | # Password validation 86 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators 87 | 88 | AUTH_PASSWORD_VALIDATORS = [ 89 | { 90 | "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", 91 | }, 92 | { 93 | "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", 94 | }, 95 | { 96 | "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", 97 | }, 98 | { 99 | "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", 100 | }, 101 | ] 102 | 103 | 104 | # Internationalization 105 | # https://docs.djangoproject.com/en/1.11/topics/i18n/ 106 | 107 | LANGUAGE_CODE = "en-us" 108 | 109 | TIME_ZONE = "UTC" 110 | 111 | USE_I18N = True 112 | 113 | USE_L10N = True 114 | 115 | USE_TZ = True 116 | 117 | 118 | # Static files (CSS, JavaScript, Images) 119 | # https://docs.djangoproject.com/en/1.11/howto/static-files/ 120 | 121 | STATIC_URL = "/static/" 122 | --------------------------------------------------------------------------------