This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Niyati Python 609 9041 essentials of Comp Prog: Assignment 1 | |
# Python Variable Practice | |
# Create a program to track student final grade | |
# The information is to store and track what grade the student is in | |
# Next info is student GPA | |
# Next info is student final grade | |
# Ask the user the student grade | |
# Ask the user the Student GPA | |
# the standard info is HS grade and GPA | |
# Python Program - TO get String or Integer Input from User |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def coalesce(*args): | |
"""Returns the first not None/Empty/False item. Similar to ?? in C#. | |
It's different from a or b, where false values are invalid. | |
:param args: list of items for checking | |
:return the first not None item, or None | |
""" | |
out = None #default return value | |
for arg in args: | |
if arg: #find first non-falsey argument | |
out = arg |