Find the year when the user will turn 100 I moved to Python today after doing a little of c++. The following code works as intended, but I want to know if I should add the if __name__ == "__main__" statement. Any other improvements?

import datetime

def inputInfo() :
    userName = input("Who are you?")
    userAge = input("How old are you?")
    return (userName , userAge)

def findYearWhenAge100(name , age) :
    currentTime = str(datetime.datetime.now())
    currentYear = int(currentTime[0: 4])
    age = 100 - int(age)
    currentYear += age
    print( name ,"is going to be 100 by", currentYear)

if __name__ == "__main__":
    userName , userAge = inputInfo()
    print(findYearWhenAge100(userName , userAge))
Your findYearWhenAge100() function has a print() statement, and returns nothing, so your __main__ doesn’t need to print the return value. 



A good habit is adding """docstrings"""  to your functions.  Eg)

def inputInfo():
    """Asks the user for name and age"""
    #... remainder of code




The userInput() function should do things like turning the userAge string into an int.  That should not be the responsibility of functions which need the age. 



Use pylint.  It will help you write more standardized code.  Things like a space is expected after a comma, not before.