Hot Date


#1


https://www.codecademy.com/courses/python-beginner-en-zFPOx/0/4

Did you remember to use the % to print the strings? Look at the example for help.

Idk


from datetime import datetime
now = datetime.now ()
print now
print now.month
print now.day
print now.year
print str(now.month) + str("/") + str(now.day) + str("/") + str(now.year)


#2

It want's you to format a string in like this:

print "Hi my name is %s!" % (name)

#3

The idea is to use templating to create the desired output string.

Eg.

    a = 3
    b = 4
    c = 5
    print "height: %s, base: %s, hypotenuse: %s." % (a, b, c)

Notice how the %s are placeholders in the template string? The order in which the variables are listed in the tuple is the order they fit into the template. Since a, b, c are type int, we could write %i. For this example %s is fine, and what to use in your solution.


#4

can someone please just give me the answer? im so confused


#5

from datetime import datetime
now = datetime.now()

print '%s-%s-%s' % (now.year, now.month, now.day)
# will print: 2014-02-19

Only two things need to change for the example to fit the solution.


#6

what is wrong with my code?


#7

Check the error message closely:

Your printed date doesn't seem to be in the proper format: mm/dd/yyyy.

You're getting closer...


#8

I still dont understand. Im sorry for any annoyance but i suck at coding


#9

The expected format does not have dashes. What does it have in their place?


#10

i dont know! help please


#11

slashes!! how do i get slashes? thanks so much for all of the previous help


#12

Forward slash on a typical US keyboard is on the same key as the ? mark. If your device has a limited keyboard, then it may take a sequence to produce that character. Let me know if this is something we should look into. Might have to call the help of another member.

If nothing else, copy this and paste it: /.


#13

thank you so much mtf!!!!!!!


#16