本文整理汇总了Python中LinkedList.myLL方法的典型用法代码示例。如果您正苦于以下问题:Python LinkedList.myLL方法的具体用法?Python LinkedList.myLL怎么用?Python LinkedList.myLL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinkedList
的用法示例。
在下文中一共展示了LinkedList.myLL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import LinkedList [as 别名]
# 或者: from LinkedList import myLL [as 别名]
def __init__(self, term, year):
self._term = term
self._year = year
# each quarter has own list of courses
self.courses = LinkedList.myLL()
self.units = 0
self.GTU = 0
self.GPA = 0
self.DefUnits = 0
示例2: getUnits
# 需要导入模块: import LinkedList [as 别名]
# 或者: from LinkedList import myLL [as 别名]
import SetupQuarter
import LinkedList
import Quarter
import Course
import re
SetupQtr = SetupQuarter.SetupQuarter()
quarters = LinkedList.myLL()
originalGPA = 0
def getUnits():
units = 0
for i in range (0, quarters.size()):
qtr = quarters.get(i)
units += qtr.getUnits()
return units
def getUnitsTaken():
defUnits = 0
for i in range (0, quarters.size()):
qtr = quarters.get(i)
defUnits += qtr.defUnits()
return defUnits
def printGPA(currQtr, diffGPA, newGPA):
if diffGPA > 0:
print("\t>\tYour " + currQtr.getName() + " GPA went UP by " + str(diffGPA) + ":", newGPA)
elif diffGPA < 0:
print("\t>\tYour " + currQtr.getName() + " GPA went DOWN by " + str(abs(diffGPA)) + ":", newGPA)
else: