diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..37af99a --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +activate_this.py \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..ac21435 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/Book1.xlsx b/Book1.xlsx new file mode 100644 index 0000000..879fe86 Binary files /dev/null and b/Book1.xlsx differ diff --git a/Euler.py b/Euler.py new file mode 100644 index 0000000..89d8737 --- /dev/null +++ b/Euler.py @@ -0,0 +1,146 @@ +import math +import functools +""" 1-ci sual +def check(x): + if x%3==0 or x%5==0: + return True + else: + return False + +sum=0 +for i in range(1,1000): + if check(i): + sum+=i +print(sum)""" + +# 2-ci sual +"""fibo_list=list() +fibo_list.append(1) +fibo_list.append(2) +index=2 +while True: + if fibo_list[index-2]+fibo_list[index-1]<4000000: + fibo_list.append(fibo_list[index-2]+fibo_list[index-1]) + index+=1 + else: + break +sum=0 +for i in fibo_list: + if i%2==0: + sum+=i +print(sum) +print(index)""" + +# 3-cu sual +"""def funksiya(x): + check=True + for j in range(2,int(math.sqrt(x))+1): + if x%j==0: + check=False + continue + return check + +num=600851475143 +biggist=1 +for i in range(2,int(math.sqrt(num))): + if num%i==0 and funksiya(i): + biggist=i +print(biggist)""" + +# 4-cu sual +"""def polindrom(x): + if str(x)==str(x)[::-1]: + return True + else: + return False +big_poli=0 +for i in range(100,1000): + for j in range(100,1000): + if polindrom(i*j) and i*j>big_poli: + big_poli=i*j +print(big_poli)""" + +# 5-ci sual +"""def gcd(x,y): + return math.gcd(x,y) #EBOB +def lcm(x,y): + return (x*y)//gcd(x,y) # EKOB +liste=range(1,21) +netice=functools.reduce(lcm,liste) +print(netice)""" + +# 6-ci sual +"""def kvadrat(): + sum=0 + for i in range(1,101): + sum+=i*i + return sum +def cem_kvadrat(): + cem=0 + for i in range(1,101): + cem+=i + return pow(cem,2) +print(cem_kvadrat()-kvadrat())""" + +# 7-ci sual +"""say=0 +def prime_check(x): + check=True + if x==2: + return True + else: + for i in range(2,int(math.sqrt(x)+1)): + if x%i==0: + check=False + break + return check + +i=2 + +while True: + if prime_check(i): + say+=1 + if say==10001: + print(i) + break + i+=1""" + +# 8-ci sual +sayi = """73167176531330624919225119674426574742355349194934 +96983520312774506326239578318016984801869478851843 +85861560789112949495459501737958331952853208805511 +12540698747158523863050715693290963295227443043557 +66896648950445244523161731856403098711121722383113 +62229893423380308135336276614282806444486645238749 +30358907296290491560440772390713810515859307960866 +70172427121883998797908792274921901699720888093776 +65727333001053367881220235421809751254540594752243 +52584907711670556013604839586446706324415722155397 +53697817977846174064955149290862569321978468622482 +83972241375657056057490261407972968652414535100474 +82166370484403199890008895243450658541227588666881 +16427171479924442928230863465674813919123162824586 +17866458359124566529476545682848912883142607690042 +24219022671055626321111109370544217506941658960408 +07198403850962455444362981230987879927244284909188 +84580156166097919133875499200524063689912560717606 +05886116467109405077541002256983155200055935729725 +71636269561882670428252483600823257530420752963450""" +liste = sayi.split("\n") +print(liste) +number = "" +for i in liste: + number += i +product = 0 +for i in range(0, len(liste)-12): + aux = 1 + for j in number[i:i+13]: + aux *= int(j) + if aux > product: + product = aux +print(product) + + + + + diff --git a/Factorial.py b/Factorial.py index 61f8531..573ead5 100644 --- a/Factorial.py +++ b/Factorial.py @@ -10,3 +10,4 @@ faktorial *=say1 say1+=1 print(f"{say1} ! = {faktorial}")""" + diff --git a/List Comprehension.py b/List Comprehension.py new file mode 100644 index 0000000..a4ae714 --- /dev/null +++ b/List Comprehension.py @@ -0,0 +1,59 @@ +liste=[1,2,3,4,5,6,9] +"""list1=[] +for i in list: + list1.append(i) +print(list1) +list2=[i for i in liste] +print(list2)""" + +"""list1=[] +for i in list: + list1.append(i*i) +print(list1) +list2=[i*i for i in liste] +print(list2)""" + +"""list1=[] +for i in liste: + if i%2 ==0: + list1.append(i) +print(list1) +list2=[i for i in liste if i%2 ==0] +print(list2)""" + +"""list1=[] +for i in list: + if i%2 ==0: + continue + list1.append(i) +print(list1) +list2=[i for i in list if not i%2 ==0] +print(list2)""" + +"""list1=[] +letter="abc" +for i in liste: + for j in letter: + list1.append((i,j)) +print(list1) +list2=[(i,j) for i in liste for j in letter] +print(list2)""" + +"""list_=[(1,2,3),(4,5,6),(7,8,9)] +list1=[] +for i in list_: + for j in i: + list1.append(j) +print(list1) +list2=[j for i in list_ for j in i] +print(list2)""" + +print(dir(list)) +list_method=[] +for method in dir(list): + if method.startswith("__"): + continue + list_method.append(method) +print(list_method) +list_method1=[method for method in dir(list) if not method.startswith("__")] +print(list_method1) diff --git a/Mixdata.txt b/Mixdata.txt new file mode 100644 index 0000000..4dbafce --- /dev/null +++ b/Mixdata.txt @@ -0,0 +1,20 @@ +Ad-Soyad Specality point1/point2/final +Delal-Abdullatif-Abzak Fizik 100/100/68 +Fatma-Özlem-Acar Matematik Müh 60/90/100 +Özde-Acarkan Kimyager 75/70/83 +Atahan-Adanır Bilgisayar Bil 30/40/65 +Hacı-Mehmet-Adıgüzel Sanat Öyr 67/89/90 +Mükerrem-Zeynep-Ağca Fizik 40/50/73 +Bestami-Ağırağaç Bioloji 90/90/90 +Aykanat-Ağıroğlu Türkçe Bil Ara 75/85/97 +Şennur-Ağnar Kimyager 89/70/81 +Tutkum-Ahmadı-Asl Tıbb 50/50/70 +Mügenur-Ahmet Bilgisayar Müh 60/50/69 +Sevinç-Ak Tıbb 88/77/71 +Kayıhan-Nedim-Akarcalı Bilgisayar Bil 100/100/97 +Lemi-Akarçay Fizik 51/51/98 +Cihan-Akarpınar Bioloji 78/56/93 +Rafi-Akaş Matematik Müh 55/62/56 +Mehmetcan-Akay Teknoloji Uzm 78/79/80 +Nuhaydar-Akbilmez Türkçe Bil Ara 45/55/67 +Emine-Münevver-Akca Sanat Öyr 88/75/96 diff --git a/Newdata1.txt b/Newdata1.txt new file mode 100644 index 0000000..28854e4 --- /dev/null +++ b/Newdata1.txt @@ -0,0 +1,11 @@ +Fatma Özlem Acar Matematik Müh 85.0 Passed +Özde Acarkan Kimyager 76.7 Passed +Hacı Mehmet Adıgüzel Sanat Öyr 82.8 Passed +Bestami Ağırağaç Bioloji 90.0 Passed +Aykanat Ağıroğlu Türkçe Bil Ara 86.8 Passed +Şennur Ağnar Kimyager 80.1 Passed +Sevinç Ak Tıbb 77.9 Passed +Kayıhan Nedim Akarcalı Bilgisayar Bil 98.8 Passed +Cihan Akarpınar Bioloji 77.4 Passed +Mehmetcan Akay Teknoloji Uzm 79.1 Passed +Emine Münevver Akca Sanat Öyr 87.3 Passed diff --git a/Newdata2.txt b/Newdata2.txt new file mode 100644 index 0000000..7006944 --- /dev/null +++ b/Newdata2.txt @@ -0,0 +1,8 @@ +Delal Abdullatif Abzak Fizik 87.2 Failed +Atahan Adanır Bilgisayar Bil 47.0 Failed +Mükerrem Zeynep Ağca Fizik 56.2 Failed +Tutkum Ahmadı Asl Tıbb 58.0 Failed +Mügenur Ahmet Bilgisayar Müh 60.6 Failed +Lemi Akarçay Fizik 69.8 Failed +Rafi Akaş Matematik Müh 57.5 Failed +Nuhaydar Akbilmez Türkçe Bil Ara 56.8 Failed diff --git a/Proje(Data structure).py b/Proje(Data structure).py new file mode 100644 index 0000000..24d1433 --- /dev/null +++ b/Proje(Data structure).py @@ -0,0 +1,65 @@ +# for lists +list_methods=[] +for method in dir(list): + if method.startswith("__"): # python-un xususi funksiyalarini elave etmesin + continue + list_methods.append(method) + +# for set +set_methods=[] +for method in dir(set): + if method.startswith("__"): # python-un xususi funksiyalarini elave etmesin + continue + set_methods.append(method) + +# for tuple +tuple_methods=[] +for method in dir(tuple): + if method.startswith("__"): # python-un xususi funksiyalarini elave etmesin + continue + tuple_methods.append(method) + +# for string +string_methods=[] +for method in dir(str): + if method.startswith("__"): # python-un xususi funksiyalarini elave etmesin + continue + string_methods.append(method) + +# for dictionary +dict_methods=[] +for method in dir(dict): + if method.startswith("__"): # python-un xususi funksiyalarini elave etmesin + continue + dict_methods.append(method) + +adlar=["List Methods","Set Methods","Tuple Methods","String Methods","Dict Methods"] +classes=[list_methods,set_methods,tuple_methods,string_methods,dict_methods] + +max_len=0 +for class1 in classes: + if len(class1)>=max_len: # en cox funksiyali methoda esasen cap etmek + max_len=len(class1) + +with open("data.txt","w") as data: + for ad in adlar: + print(ad,end="") # title-lari cap etmek + print(" "*(30-len(ad)),end="") + data.write(ad) + data.write(" "*(30-len(ad))) + + for i in range(max_len): + print() + data.write("\n") + for class1 in classes: + if i>=len(class1): + print("-------",end="") + print(" "*23,end="") + data.write("-------") + data.write(" "*23) + else: + print(class1[i],end="") + print(" "*(30-len(class1[i])),end="") # seliqeli gorunus ucun + data.write(class1[i]) + data.write(" "*(30-len(class1[i]))) + diff --git a/Proje(Kecid bal).py b/Proje(Kecid bal).py new file mode 100644 index 0000000..870c565 --- /dev/null +++ b/Proje(Kecid bal).py @@ -0,0 +1,50 @@ +with open("Mixdata.txt") as f: + with open("Newdata1.txt","w") as g: + with open("Newdata2.txt","w") as k: + inner=f.readlines() + m=0 + for row in inner: + if m==0: + m+=1 + continue + row=row.replace("\n","") + space_num=0 + space_indexs=[] + index=0 + for value in row: + if value==" ": + space_num+=space_num + space_indexs.append(index) + index+=1 + ad_soyad=row[:space_indexs[0]] + soyad=ad_soyad.split("-")[-1] + ad=ad_soyad[:ad_soyad.index(soyad)-1].replace("-"," ") + points=row.split(" ")[-1] + points=points.split("/") + point1= int(points[0]) + point2= int(points[1]) + final= int(points[2]) + ortalama=point1*0.3+point2*0.3+final*0.4 + specialty=row[space_indexs[0]+1:space_indexs[len(space_indexs)-1]] + if ortalama>=70 and final>=70: + g.write(ad) + g.write(" "*(25-len(ad))) + g.write(soyad) + g.write(" "*(25-len(soyad))) + g.write(specialty) + g.write(" "*(25-len(specialty))) + g.write(str(round(ortalama,1))) + g.write(" "*21) + g.write("Passed") + g.write("\n") + else: + k.write(ad) + k.write(" " * (25 - len(ad))) + k.write(soyad) + k.write(" " * (25 - len(soyad))) + k.write(specialty) + k.write(" " * (25 - len(specialty))) + k.write(str(round(ortalama, 1))) + k.write(" " * 21) + k.write("Failed") + k.write("\n") \ No newline at end of file diff --git a/Python1/Python2/Text3.txt b/Python1/Python2/Text3.txt new file mode 100644 index 0000000..ab0824f --- /dev/null +++ b/Python1/Python2/Text3.txt @@ -0,0 +1,2 @@ +qwertyuiop[]\asdfghjkl;;['blfbfbdf;ssx +S\q]q360457945tf;sdlgdfhlf \ No newline at end of file diff --git a/Python1/Text2.txt b/Python1/Text2.txt new file mode 100644 index 0000000..e69de29 diff --git a/data.txt b/data.txt new file mode 100644 index 0000000..dcba588 --- /dev/null +++ b/data.txt @@ -0,0 +1,48 @@ +List Methods Set Methods Tuple Methods String Methods Dict Methods +append add count capitalize clear +clear clear index casefold copy +copy copy ------- center fromkeys +count difference ------- count get +extend difference_update ------- encode items +index discard ------- endswith keys +insert intersection ------- expandtabs pop +pop intersection_update ------- find popitem +remove isdisjoint ------- format setdefault +reverse issubset ------- format_map update +sort issuperset ------- index values +------- pop ------- isalnum ------- +------- remove ------- isalpha ------- +------- symmetric_difference ------- isascii ------- +------- symmetric_difference_update ------- isdecimal ------- +------- union ------- isdigit ------- +------- update ------- isidentifier ------- +------- ------- ------- islower ------- +------- ------- ------- isnumeric ------- +------- ------- ------- isprintable ------- +------- ------- ------- isspace ------- +------- ------- ------- istitle ------- +------- ------- ------- isupper ------- +------- ------- ------- join ------- +------- ------- ------- ljust ------- +------- ------- ------- lower ------- +------- ------- ------- lstrip ------- +------- ------- ------- maketrans ------- +------- ------- ------- partition ------- +------- ------- ------- removeprefix ------- +------- ------- ------- removesuffix ------- +------- ------- ------- replace ------- +------- ------- ------- rfind ------- +------- ------- ------- rindex ------- +------- ------- ------- rjust ------- +------- ------- ------- rpartition ------- +------- ------- ------- rsplit ------- +------- ------- ------- rstrip ------- +------- ------- ------- split ------- +------- ------- ------- splitlines ------- +------- ------- ------- startswith ------- +------- ------- ------- strip ------- +------- ------- ------- swapcase ------- +------- ------- ------- title ------- +------- ------- ------- translate ------- +------- ------- ------- upper ------- +------- ------- ------- zfill ------- \ No newline at end of file diff --git a/files.py b/files.py new file mode 100644 index 0000000..0db0683 --- /dev/null +++ b/files.py @@ -0,0 +1,39 @@ +"""f=open("test1","r") # fayli acib oxumaq +inner=f.read() +print(inner) +f.close()""" # fayli baglamak + +"""with open("test1") as file: + for satir in file: + print(satir,end="") # \n-leri yox etmek""" + +"""with open("test1") as f: # test1-deki yazini test2-e yazmaq + with open("test2","w") as W: + for satir in f: + W.write(satir)""" + +"""with open("test1") as file: + f=file.readlines() # ekrana list seklinde cixaracaq + print(f)""" + +"""with open("test1") as file: + f=file.readline() # 1 setiri ekrana cixarir + print(f,end="") + print(file.tell()) # imlecin yerini gosterir + file.seek(0) # imlecin yerini deyisdirir + f=file.readline() + print(f,end="") + f=file.readline() + print(f,end="")""" + +"""with open("test2","a") as wfile: # file-a elave edir + wfile.write("Azerbaijan ")""" + +"""with open("pythonpng.jpeg","rb") as f: + with open("python.png","wb") as w: # text tipinde olmayan fayllarla yazma ve oxuma + for satir in f: + w.write(satir)""" + + + + diff --git a/funk.py b/funk.py new file mode 100644 index 0000000..db1c82d --- /dev/null +++ b/funk.py @@ -0,0 +1,49 @@ +import os +import selenium +import time +import datetime +# random modulu +import random +"""for i in range(10): + print(random.random()) # 0-1 arasi 10 reqemi ekrana cixaracaq +for i in range(10): + print(random.uniform(1.2,10.3)) #1.2-10.3 arasi float ededleri ekrana cixarir +for i in range(10): + print(random.randint(2,15)) # 1-16 arasi tam ededleri ekrana cixarir +for i in range(10): + print(random.randrange(2,10,2)) # 2-10 arasi ededleri 2 addimla secir +liste=[3,4,7,8,9,15] +print(random.choice(liste)) # list-den random secir +liste1=["Windows","Linux","Android"] +print(random.choice(liste1)) +l=random.shuffle(liste) # list-in elementlerini qarisdirir +print(liste) +print(random.sample(liste,4)) # 4 elementi random secir +# Time modulu +import time +print(time.time()) # strainger time +print(time.ctime()) # now time +print(time.localtime()) # yerli time +print(time.asctime(time.localtime())) # now time +print(time.strftime("12/12/2022")) # str-i ekrana cixarir +print("ishe basladi") +time.sleep(3) # 3 saniye sonra ekrana cixarir +print("ishi qurtardi") +zarlar={1:0,2:2,3:4,4:6,5:8,6:10} +for i in range(100): + zar= random.randint(1,6) + zarlar[zar]+=1 # zarin dusme ehtimali +for zar in zarlar: + print(f"{zar} gelme ehtimali: {zarlar[zar]}")""" +"""alti_alti=0 +check=0 +while True: + check+=1 + zar1=random.randint(1,6) + zar2=random.randint(1,6) #6-6 10 defe dusmesi ucun yoxlama sayi + if zar1==6 and zar2==6: + alti_alti+=1 + if alti_alti==10: + print(f"10 defe 6-6 cixmasi ucun {check} qeder yoxlama edib!") + break""" + diff --git a/funksiya.py b/funksiya.py new file mode 100644 index 0000000..439a158 --- /dev/null +++ b/funksiya.py @@ -0,0 +1,23 @@ +"""def Toplama(x,y): + print(f"x+y= {x+y}") # void-e benzerdir +def Hasil(x,y): + return x*y # deyer qaytarir + +x=3 +y=4 +Toplama(x,y) +print(Hasil(x,y)) +print(type(Toplama)) # funksiya +print(type(Hasil(x,y))) # integer +print(type(Toplama(x,y))) # nonetype (tipsiz):) +def ortalama(liste): + toplam=sum(liste) + say=len(liste) + return toplam/say +print(ortalama([1,3,5,7,9])) # funksiyaya send list +def name(ad="Laman"): + print(f"Menim adim {ad}-dir") + return ad.upper() + +print(name("Mianleis"))""" + diff --git a/main.py b/main.py index 65f4cc7..5596b44 100644 --- a/main.py +++ b/main.py @@ -1,86 +1,16 @@ -book=["kitab","defter","qelem"] # list -saylar=[1,5,7,9,8,0] -""" -print(book) -book.append("yonan") # elave etmek -print(book) -book.insert(2,"pozan") # indekse gore elave etmek -print(book) -book.extend(["silgi","xetkes"]) # list-i ayri elave etmek -print(book) -book.remove("defter") # elementi silmek -print(book) -silinen=book.pop() # sonuncu elementi silir -print(silinen) -print(book) -book.reverse() # tersine ekrana cixarma -print(book) -print(sorted(book)) # siralayir ve listi deyismir -print(book) # yuxaridaki ile eynidir)) -book.sort() -print(book) # siralayir ve listi deyisdirir -print(min(saylar)) # en kicik -print(min(book)) # en 1-ci element -print(max(saylar)) # en boyuk -print(max(book)) # en sonuncu -print(sum(saylar)) # cemini hesablamaq -print(list(enumerate(book))) # indeksle listin elementlerini yazir -print(list(enumerate(saylar,start=3))) # listin elementlerinin indeksi start-la baslayir -mesaj="-".join(book) # listi stringe cevirir -print(mesaj) -print(mesaj.split("-")) # stringi liste cevirir -if 5 > 2: - print("Five is greater than two!")""" - # tuple ve set ve dictionary -"""tpl=("ADNSU","ADU","BDU","BANM","AzTU") -print(tpl) -print(len(tpl)) -setler={"insan","heyvan","nitq","Heserat"} -setler1={"insan","real","data","heyvan"} -print(setler) -setler.add("nitq") -print(setler) -# setler.remove("Heserat") -# setler.remove("kitab") olmayan bir seyi silmeye calismaq ve sehv verecek) -# setler.discard("kitab") sehv vermeyecek( -print(setler.intersection(setler1)) -print(setler.union(setler1)) -print(setler.difference(setler1)) -print(setler1.difference(setler)) -print(set("PYTHON")) -freelist=[] # listdir -freelist1=list() -freetuple=() # tuple-dir -freetuple1=tuple() -freeset=set() # setdir -freeset1={} # dictionary-dir -print(type(freelist),type(freelist1)) -print(type(freetuple),type(freetuple1)) -print(type(freeset),type(freeset1))""" -# dictionary -adam={"isim":"Laman","Soyisim":"Mikayilova","Yas":19,"Qrup":603.21} -print(adam) -print(type(adam)) -print(adam["isim"]) # key-e gore value-ni ekrana yazir -adam["isim"]="Nazrin" # keyin value-sini deyismek -adam["sinif"]="10L" # yeni key ve value elave etmek -print(adam["isim"],adam["sinif"]) -del(adam["Qrup"]) # silmek -adam.update({"isim":"Amin","Soyisim":"Mikayilov","sinif":4,"Yas":9}) # key ve value-ni deyismek -print(adam) -"""for i in adam: - print(i) # key-leri ekrana cixarir""" -"""for i in adam: - print(adam[i]) # value-leri ekrana cixarir -print(adam.keys()) # key-leri ekrana cixarir -print(adam.values()) # value-leri ekrana cixarir -print(adam.items()) # key ve value-leri ekrana cixarir -for i,j in adam.items(): - print(i,j) # her ikisini ekrana cixarir""" -for i in adam.items(): - print(i) # dirnaq icerisinde her ikisini ekrana cixarir -print(adam.get("isim")) # axtarir ve sehv olarsa,sehvi gostermir -print(adam.get("ad","Laman")) +# This is a sample Python script. +# Press Shift+F10 to execute it or replace it with your code. +# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. +def print_hi(name): + # Use a breakpoint in the code line below to debug your script. + print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint. + + +# Press the green button in the gutter to run the script. +if __name__ == '__main__': + print_hi('PyCharm') + +# See PyCharm help at https://www.jetbrains.com/help/pycharm/ diff --git a/os modul.py b/os modul.py new file mode 100644 index 0000000..60a9cc1 --- /dev/null +++ b/os modul.py @@ -0,0 +1,89 @@ +import os +from datetime import datetime + +"""print(os.getcwd()) +os.chdir("C:/Users/User-HP/PycharmProjects/pythonProject") +os.mkdir("C:/Users/User-HP/PycharmProjects/pythonProject/book") +for file in os.listdir(): + print(file) +os.makedirs("Python1/Python2/Python3") +for i,j,k in os.walk("C:/Users/User-HP/PycharmProjects/pythonProject/Python1"): + print(f"Path: {i}") + print(f"Folder: {j}") + print(f"File: {k}") + print("---------------------------------------------------------------------------------------------------------------") +print(os.path.isfile("Euler.py")) +print(os.path.isdir("Python3")) +print(os.path.splitext("sade_murekkeb_reqem.py")) +os.rename("book","kitab") +os.rmdir("kitab") +os.removedirs("Python1/Python2/Text3.txt") +for i,j,k in os.walk("C:/Users/User-HP/PycharmProjects/pythonProject/Python1/Python2"): + print(i) + print(j) + print(k) + print("****************************************************************************************************************") +os.remove("Text3.txt")""" +# file-lari uzantilarina gore folder-lere ayirmaq +"""def sirala(): + folder=input("Siralanacaq folder: ") + files=[] #file-lar yigilacaq + uzantilar=[] # uzantilar yigilacaq + def list_dir(): + for file in os.listdir(folder): + if os.path.isdir(os.path.join(folder,file)): # file folder-dir mi? + continue + if file.startswith("."): # file hide-dirmi? + continue + else: + files.append(file) + list_dir() + # Uzantilari almaq + for file in files: + uzanti=file.split(".")[-1] + if uzanti in uzantilar: # Uzanti daha evvel elave olundu? + continue + else: + uzantilar.append(uzanti) + for uzanti in uzantilar: # folder yaradilir + if os.path.isdir(os.path.join(folder,uzanti)): + continue + else: + os.mkdir(os.path.join(folder,uzanti)) + for file in files: + uzanti=file.split(".")[-1] + os.rename(os.path.join(folder,file),os.path.join(folder,uzanti,file)) +sirala()""" +# file-lari tarixlerine gore folder-lere ayirmaq +def tarixle(): + folder = input("Ayrilacaq folder: ") + files = [] # file-lari yigacaq + tarixler = [] # tarix-leri yigacaq + def tarix_dir(): + for file in os.listdir(folder): + if os.path.isdir(os.path.join(folder, file)): # file folder-dir mi? + continue + if file.startswith("."): # file hide-dir mi? + continue + else: + files.append(file) + tarix_dir() + # Tarixleri almaq + for file in files: + tarix_damgasi = os.stat(os.path.join(folder, file)).st_birthtime + tarix = datetime.fromtimestamp(tarix_damgasi).strftime("%d-%m-%Y") + if tarix in tarixler: # tarix daha evvel elave olunub? + continue + else: + tarixler.append(tarix) + for tarix in tarixler: + if os.path.isdir(os.path.join(folder, tarix)): + continue + else: + os.mkdir(os.path.join(folder, tarix)) + for file in files: + tarix_damgasi = os.stat(os.path.join(folder, file)).st_birthtime + tarix = datetime.fromtimestamp(tarix_damgasi).strftime("%d-%m-%Y") + os.rename(os.path.join(folder, file), os.path.join(folder, tarix, file)) +tarixle() + diff --git a/python.png b/python.png new file mode 100644 index 0000000..7b73653 Binary files /dev/null and b/python.png differ diff --git a/pythonpng.jpeg b/pythonpng.jpeg new file mode 100644 index 0000000..7b73653 Binary files /dev/null and b/pythonpng.jpeg differ diff --git a/sade_murekkeb_reqem.py b/sade_murekkeb_reqem.py new file mode 100644 index 0000000..1946fa1 --- /dev/null +++ b/sade_murekkeb_reqem.py @@ -0,0 +1,157 @@ +#eded=int(input("Ededi daxil edin ")) + +# sade veya murekkeb olmasi +"""check=True +for i in range(2,eded): + if eded % i==0: + check=False + break +if check==True: + print(f"{eded} sade ededdir") +else: + print(f"{eded} murekkeb ededdir")""" + +# Musbet bolenlerin sayi +"""count=0 +for i in range(1,eded+1): + if eded%i==0: + count+=1 +print(f"{eded}-in musbet bolenlerinin sayi {count}-dir")""" + +# ededin reqemleri cemini tapmaq +toplam=0 +# 1-ci usul +"""str_s=str(eded) # string-e cevirerek +for i in str_s: + toplam+=int(i) +print(toplam)""" +# 2-ci usul +"""while eded!=0: + c=eded%10 # riyazi yolla + toplam+=c + eded=eded//10 +print(toplam)""" + +# ekrandan daxil edilen 5 ededin en boyuk ve kiciyini tapin +"""liste=[] +for i in range(5): + rakam=int(input("Eded daxil edin: ")) + liste.append(rakam) +print(f"En boyuk eded : {max(liste)}") +print(f"En kucuk eded : {min(liste)}")""" + +# ekrandan daxil edilen ededin her hansi ededin kvadrati olub-olmadigini yoxlayan proqram + +# 1-ci usul +"""eded=int(input("Eded daxil edin: ")) +check=False +for i in range(1,eded): + if eded/i==i: + check=True + break +if check==True: + print(f"{eded} {i}-in kvadratidir") +else: print(f"{eded} tam ededin kvadrati deyil") + +# 2-ci usul +kvadrat=eded**0.5 +if kvadrat==int(kvadrat): + print("Kvadratidir") +else: print("Kvadrati deyil")""" + +# ekrandan daxil edilen sozde hansi herifin nece defe islendiyini tapan proqram +"""metn=input("Ifade veya soz daxil edin: ") +sozluk=dict() +for harf in metn: + if harf in sozluk: + sozluk[harf]+=1 + else: + sozluk[harf]=1 +for harf,say in sozluk.items(): + print(harf,say)""" + +# ekrandan daxil edilen metnde a harf-larini boyuk eden program +"""metn=input("Metn daxil edin: ") +metn1="" +for harf in metn: + if harf=="a": + metn1+="A" + else: + metn1+=harf +print(metn1)""" + +# ilk 10.000 sade ededin necesi 3-le baslayib 7-le biter +"""list1= list() +list1.append(2) +say=3 +while True: + check=True + for i in range(2,int(say**0.5)+1): # proqramin suretini artirmaq ucun + if say%i==0: + check=False + break + if check: + list1.append(say) + if len(list1)==10000: + break + say+=1 +list2=[] +for j in list1: + strcheck=str(j) + if strcheck.startswith("3") and strcheck.endswith("7"): + list2.append(j) +print(list2)""" + +# 3 reqemli ededlerin necesi reqemlerinin kublari cemine beraberdir(Armstrong ededleri) +"""sum_list=[] +for reqem in range(100,1000): + sum=0 + say=reqem + while say!=0: + c=say%10 + sum+=c**3 + say=say//10 + if sum==reqem: + sum_list.append(reqem) +print(sum_list)""" + +# Fibonacci ededlerinin 100-unu cap edin +"""fibo_list=[] +fibo_list.append(1) +fibo_list.append(1) +index=2 +for i in range(2,100): + fibo_list.append(fibo_list[i - 2] + fibo_list[i - 1]) # for-la +while True: + fibo_list.append(fibo_list[index-2]+fibo_list[index-1]) # while-la + index+=1 + if len(fibo_list)==100: + break +print(fibo_list)""" + +# 100 reqemli ilk fibonacci ededini ve sira nomresini cap edin +"""fibo_list=list() +fibo_list.append(1) +fibo_list.append(1) +index=2 +while True: + fibo_list.append(fibo_list[index-2]+fibo_list[index-1]) + deyisken=fibo_list[index-2]+fibo_list[index-1] + if len(str(deyisken))==100: + print(deyisken) + print(index) + break + index+=1""" + + + + + + + + + + + + + diff --git a/test1 b/test1 new file mode 100644 index 0000000..32ea3d8 --- /dev/null +++ b/test1 @@ -0,0 +1,24 @@ +Azerbaijan! Azerbaijan! +O triumphant fatherland of sons of heroes! +We are all ready to bestow our lives on thee! +We are fain to shed our very own blood for thee! +With the banner of three colors blessed be thou! +With the banner of three colors blessed be thou! + +Thousands of lives were sacrificed, +Thy soul a battlefield became, +Of every soldier devoted, +Each one of them heroes became! + +Blossom like a rose garden, +My life ever sworn to thee, +A thousand one loves for thee, +In my heart rooted deeply! + +To stand on guard for thine honour, +Bearing aloft thy sacred flag; +To stand on guard for thine honour, +Eager be every youthful heir! +Glorious Homeland! Glorious Homeland! +Azerbaijan! Azerbaijan! +Azerbaijan! Azerbaijan! \ No newline at end of file diff --git a/test2 b/test2 new file mode 100644 index 0000000..32ab2fb --- /dev/null +++ b/test2 @@ -0,0 +1,24 @@ +Azerbaijan! Azerbaijan! +O triumphant fatherland of sons of heroes! +We are all ready to bestow our lives on thee! +We are fain to shed our very own blood for thee! +With the banner of three colors blessed be thou! +With the banner of three colors blessed be thou! + +Thousands of lives were sacrificed, +Thy soul a battlefield became, +Of every soldier devoted, +Each one of them heroes became! + +Blossom like a rose garden, +My life ever sworn to thee, +A thousand one loves for thee, +In my heart rooted deeply! + +To stand on guard for thine honour, +Bearing aloft thy sacred flag; +To stand on guard for thine honour, +Eager be every youthful heir! +Glorious Homeland! Glorious Homeland! +Azerbaijan! Azerbaijan! +Azerbaijan! Azerbaijan!Azerbaijan \ No newline at end of file diff --git a/yoxlama.py b/yoxlama.py new file mode 100644 index 0000000..6e6b2d7 --- /dev/null +++ b/yoxlama.py @@ -0,0 +1,2 @@ +x = [15,10,2,84] + [1,4,8,7,9] +x.index(x.count(x[0]))