NCTU GPA calculator written in python2 Input Example
文章推薦指數: 80 %
NCTU GPA calculator written in python2 Input Example: 成績1,學分數1 成績2,學分數2 成績3,學分數3 ... - gpa_calc.py. Skiptocontent Allgists BacktoGitHub Signin Signup Sign in Sign up {{message}} Instantlysharecode,notes,andsnippets. M157q/gpa_calc.py LastactiveDec29,2015 Star 1 Fork 1 Star Code Revisions 2 Stars 1 Forks 1 Embed Whatwouldyouliketodo? Embed Embedthisgistinyourwebsite. Share Copysharablelinkforthisgist. Clonevia HTTPS ClonewithGitorcheckoutwithSVNusingtherepository’swebaddress. LearnmoreaboutcloneURLs DownloadZIP NCTUGPAcalculatorwritteninpython2InputExample:成績1,學分數1成績2,學分數2成績3,學分數3... Raw gpa_calc.py ThisfilecontainsbidirectionalUnicodetextthatmaybeinterpretedorcompileddifferentlythanwhatappearsbelow.Toreview,openthefileinaneditorthatrevealshiddenUnicodecharacters. LearnmoreaboutbidirectionalUnicodecharacters Showhiddencharacters #-*-coding:utf-8-*- deffind_gpa(grade): if100>=grade>=90: return[grade,'A+',4.3] elif89>=grade>=85: return[grade,'A',4.0] elif84>=grade>=80: return[grade,'A-',3.7] elif79>=grade>=77: return[grade,'B+',3.3] elif76>=grade>=73: return[grade,'B',3.0] elif72>=grade>=70: return[grade,'B-',2.7] elif69>=grade>=67: return[grade,'C+',2.3] elif66>=grade>=63: return[grade,'C',2.0] elif62>=grade>=60: return[grade,'C-',1.7] elif59>=grade>=50: return[grade,'D',1.0] elif49>=grade>=1: return[grade,'E',0.0] elifgradeis0: return[grade,'X',0.0] else: returnNone defmain(): #InputExample:成績1,學分數1成績2,學分數2成績3,學分數3... g=raw_input('Enteryourgrade:') g=g.strip().split() l=[] forxing: x=x.split(',') t=find_gpa(int(x[0])) iftisnotNone: t.append(x[1]) l.append(t) else: raiseBaseException('Youhavewronggrade.') avg=0.0 gpa=0.0 weights=0 forxinl: print('{0:4d}{1:2s}{2:1.1f}{3}'.format(x[0],x[1],x[2],x[3])) avg+=float(x[0])*int(x[3]) gpa+=float(x[2])*int(x[3]) weights+=int(x[3]) print('yourAVGgrade:{0}'.format(avg/weights)) print('yourGPA:{0}'.format(gpa/weights)) if__name__=="__main__": main() Signupforfree tojointhisconversationonGitHub. Alreadyhaveanaccount? Signintocomment Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.
延伸文章資訊
- 1NYCU GPA 計算機
國立陽明交通大學GPA 計算機,幫助你快速計算overall 以及後60 學分GPA.
- 2等第績分平均(GPA)單向轉換為百分制成績對照表
等第績分平均(GPA)單向轉換為百分制成績對照表. 績分平」對應之」績分平|對應之」績分平|對應之」績分平|對應之」績分平「對應之」績分平|對應之. 均GPA | 百分数」 ...
- 3GPA換算器】操作超簡單-提供百分制及四等分制的GPA計算
GPA 計算機、GPA換算器可以幫你從百分制換算GPA,也提供四等分制計算。百分制標準採用台大、成大、交大、東華等校一樣的標準,讓你輕鬆計算.
- 4推薦文章 - 靠北交大2.0
給#靠交4082 GPA 計算機https://nctu-gpa-calculator.vercel.app/
- 5新學期成績算法跟排名 - 交通大學板 | Dcard
國立交通大學. LINK. 新學期成績算法跟排名. 交通大學. 2021年7月16日12:51 ... 共24 則留言. 國立交通大學. 1. 所以109 第二學期就開始用gpa 算排名了?