ros.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:ROS-Code 作者: Richienb 项目源码 文件源码
def equation(operation, firstnum, secondnum):
    if not isnumber(firstnum) and isnumber(secondnum):
        raise RuntimeError('An Error Has Occured: One Of The Values Specified Is Not A Number (0002)')
    if operation == 'plus':
        return (firstnum + secondnum)
    elif operation == 'minus':
        return (firstnum - secondnum)
    elif operation == 'multiply':
        return (firstnum * secondnum)
    elif operation == 'divide':
        return (firstnum / secondnum)
    else:
        raise RuntimeError('An Error Has Occured: You Entered An Invalid Operation (0003)')

# Preform Scientific Operations
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号