Created
August 1, 2016 03:17
-
-
Save LNMayfield3/7c475f34864ddf2cac466d6d7a5a093b to your computer and use it in GitHub Desktop.
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
import datetime # This import the date function | |
print (datetime.date.today()) # This prints today's date | |
currentDay= datetime.date.today() #this declares currentDay as avariable that is assigned to datetime | |
print("Greeting 's to you and yours\n") # greeting to the user and the \n make the program skip to a new line | |
name =input("Please enter your full name :")#this declares name as avariable that is assigned get the users name by displaying a request on the screen to the user | |
print (name.lower()) # prints out the users name but controls how it is displayed on the screen .lower() make the users name all lowercase no matter how they type it in | |
print (name.upper())# prints out the users name but controls how it is displayed on the screen .upper() make the users name all uppercase no matter how they type it in | |
print (name.swapcase())# prints out the users name but control how it is displayed on the screen lower() make the users name all lower case no matter how they type it in | |
print("Here is a string "+str(currentDay .day)+"\n" ) | |
print(currentDay.strftime('%b%d%y \n')) | |
#This formats the order of the date to month day year if you swap them you rearrange the order | |
yearofbirth=int(input("enter the year you were born : ")) | |
age= currentDay.year-yearofbirth | |
print (name+" is currently "+str(age)+" years of age.") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment