<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def toVName(name, stripNum=0, upper=False):
 """ Turn a Python name into an iCalendar style name, optionally uppercase and with characters stripped off. """

    if upper:
        name = name.upper()
    if stripNum != 0:
        name = name[:-stripNum]
    return name.replace('_', '-')