Tuesday, March 12, 2019

Python Tutorial - Age calculator

Python Tutorial

Input box- To get value from user, In this code below we will look at an example of saying
 hello to user after user enter his/her name
In [3]:
s=input("what is your name")
print("Hello " + s)
what is your nameRohit
Hello Rohit

Age calculator

In this programe we will look at an example of code which show the age of a user after user
 enter his/her Year of Birth.
in this example we are taking input as string and converting them in integer 
which further after calculation is being converted into sring to print the msg.
In [15]:
Years=input("What is you year of Birth")
Yearsasint=int(Years)
Age=2019-Yearsasint
print("Your Age is " + str(Age))
What is you year of Birth1989
Your Age is 30

Age Calcultor with current year function

In [17]:
import datetime
now=datetime.datetime.now()
Years=input("What is you year of Birth")
Yearsasint=int(Years)
Age=now.year-Yearsasint
print("Your Age is " + str(Age))
What is you year of Birth1989
Your Age is 30

JOB in 2019

Automated - Digital One o One Meetings- An Idea

                                            Automated - Digital One o One Discussion                                                       ...