Date and Time

On this assignment called “Date and Time” we had to learn more about strings and use our knowledge on code academy (python). First we had to follow the instructions under to complete the program. On the second slide we had to create a variable called “now” and store the result of “datetime.now”, then we had to print the value “now”. On the third slide we had to print “now.year,now.month and now.day”. On the fourth slide we and to print the current date in the form of mm/dd/yyyy, then we to replace the ” – ” character with the ” / ” character between the %s operator. On the fifth slide we had a similar code to do than the previous slide but instead of printing the date we had to print the time in the format of “hour, minutes and seconds”. We also had to change the characters ” / ” with ” : “. On the last slide we had to print all of the strings together and to add three more operators with the ” / ” characters between them. Eventually the print would have to be like (now.month, now.day, mow.year, now.hour, now.minute, now.second

).date-and-time-1 date-and-time-2 date-and-time-3 date-and-time-4 date-and-time-5 date-and-time-6