Program(GPA)
def is_poor_attendance(a,b=15):#Aは出席回数、Bは総授業回数
    return a/b<2/3
def get_grade_point(c,a,b=15):#Cは得点
    if is_poor_attendance(a,b):
        return 0
    else:
        match c//10:
            case 10|9:
                return 4
            case 8:
                return 3
            case 7:
                return 2
            case 6:
                return 1
            case _:
                return 0
def calc_gpa(x):#yは単位数
    d=0
    e=0
    for i in x:
        b=15 if len(i)<3 else i[2]
        y=2 if len(i)<4 else i[3]
        f=get_grade_point(i[0],i[1],b)
        d+=f*y
        e+=y
    return d/e if e>0 else 0
a,b,c,d,e,f,i,x,y変更可能
No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
Previous
Next