NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io


from pprint import pprint

class THTPuanlayici(object):

def __init__(self, username:str, userRankName: str) -> None:
self.username = username
self.rankName = userRankName

self.ranks = {
0:{
"rank":"Muaf",

},
1:{
"rank":"Çaylak",
"Konu":1,
"Yardım Merkezi":15,
"İhbar":40
},

2:{
"rank":"Asistan",
"Konu":1,
"Yardım Merkezi":15,
"İhbar":50

},

3:{
"rank":"Moderatör",
"Konu":1,
"Yardım Merkezi":10,
"İhbar":60

},

4:{
"rank":"Deneyimli Moderatör",
"Konu":1,
"Yardım Merkezi":10,
"İhbar":60

},

5:{
"rank":"Kıdemli Moderatör",
"Konu":0,
"Yardım Merkezi":10,
"İhbar":30

},

}

def readRanksDetails(self) -> tuple:
if self.rankName in self.ranks:
__data = (self.ranks.get(self.rankName, None))
return __data.get("Konu"), __data.get("Yardım Merkezi"), __data.get("İhbar"), __data.get("rank")
else:
return False

def hesaplaİhbar(self, ihbarSayisi: int) -> tuple:
if self.readRanksDetails():
__konu, __ym, __ihbar, __ranksname = self.readRanksDetails()
cezaPuan = 0
if ihbarSayisi < __ihbar:
cezaPuan = (__ihbar - ihbarSayisi) * 5

score = ihbarSayisi * 5 - cezaPuan
return score, cezaPuan

def hesaplaYM(self, YMSayisi: int) -> tuple:
if self.readRanksDetails():
__konu, __ym, __ihbar, __ranksname = self.readRanksDetails()
cezaPuan = 0
if YMSayisi < __ym:
cezaPuan = (__ym - YMSayisi) * 10

score = YMSayisi * 10 - cezaPuan
return score, cezaPuan

def hesaplaKonu(self, KonuSayisi: int) -> tuple:
if self.readRanksDetails():
__konu, __ym, __ihbar, __ranksname = self.readRanksDetails()
cezaPuan = 0
if KonuSayisi < __konu:
cezaPuan = (__konu - KonuSayisi) * 100

score = KonuSayisi * 100 - cezaPuan
return score, cezaPuan

def sosyalMedyaPuan(self, smpuan:int):
return smpuan * 5

def saveFile(self, text:str):
with open("rapor.txt", mode="w", encoding="utf-8") as file:
file.write(text)








def main():
print("""
(0, 'Muaf')
(1, 'Çaylak')
(2, 'Asistan')
(3, 'Moderatör')
(4, 'Deneyimli Moderatör')
(5, 'Kıdemli Moderatör')


""")
__username = str(input("Kullanıcı adını girin : "))
__userRank = int(input("Kullanıcı rankını girin : "))
__ihbar = int(input("Kullanıcı ihbar sayısını girin: "))
__ym = int(input("Kullanıcı Yardım Merkezi sayısını girin : "))
__konu = int(input("Kullanıcı Konu sayısını girin : "))
__smPuan = int(input("Kullanıcının sosyal medya puanını girin (Zorunlu değil ) : "))
__gecenHaftaPuan = int(input("Kullanıcının geçen haftaki puanı (yoksa 0 yazın ) : "))
__ekPuan = int(input("Kullanıcının ek puanı varsa onu girin (yoksa 0 yazın ) : "))


if __userRank != 0:
App = THTPuanlayici(username=__username, userRankName=__userRank)
if App.readRanksDetails():
smmPuanCal = App.sosyalMedyaPuan(smpuan=__smPuan) if __smPuan > 0 else 0

ihbar = App.hesaplaİhbar(ihbarSayisi=__ihbar)
ym = App.hesaplaYM(YMSayisi=__ym)
konu = App.hesaplaKonu(KonuSayisi=__konu)

__toplamPuan = konu[0] + konu[1] + ihbar[0] + ihbar[1] + ym[0] + ym[1] + smmPuanCal + __ekPuan

result = (f"""


⤿ Kullanıcı Adı : {__username}
⤿ Kullanıcı Rankı : {App.readRanksDetails()[-1]}

-------
⤿ Açtığı Toplam Konu Sayısı :{__konu}
⤜ Konudan Aldığı Puan : {konu[0]}
⤜ Ceza Puanı : {konu[1]}
⤜ Net Puan : {konu[0] + konu[1]}


⤿ Toplam İhbar Sayısı : {__ihbar}
⤜ İhbardan Aldığı Puan : {ihbar[0]}
⤜ Ceza Puanı : {ihbar[1]}
⤜ Net Puan : {ihbar[0] + ihbar[1]}

⤿ Toplam Yardım Merkezi Sayısı : {__ym}
⤜ Yardım Merkezinden Aldığı Puan : {ym[0]}
⤜ Ceza Puanı : {ym[1]}
⤜ Net Puan : {ym[0] + ym[1]}

⤿ Sosyal medya Puanı : {smmPuanCal}
⤿ Ek Puanı : {__ekPuan}
⤿ Geçen Hafta Puanı : {__gecenHaftaPuan}
---

〤 Bu Haftanın Puanı {__toplamPuan} 〤
〤 Toplam Puanı {__toplamPuan + __gecenHaftaPuan} 〤

""")

print(result)
App.saveFile(text=result)


else:
print("Lütfen Bu Formata uygun şekilde değer girin : ")
pprint(App.ranks)

else:
print("Kullanıcı muaf ! ")
if __name__ == "__main__":
main()

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.