What did I do wrong



Oops, try again. It looks like your printed time is not in the proper format: hh:mm:ss

It to let me pass

Replace this line with your code. 
from datetime import datetime
now = datetime.now()

print '%s:/%s:/%s' % (now.hour, now.minute, now.second)


You seem to have needless slashes. Please remove. See below.

print '%s:%s:%s' % (now.hour, now.minute, now.second)

Hope this helps! :slight_smile:


Thanks a lot : srry about replying late::slight_smile:


It's fine.

Have fun coding! :slight_smile:


What is wrong? I am in the Grand Finale.
print'%s/%s/%s %s:%s:%s'(now.month, now.day, now.year, now.hour, now.minute, now.second)


How you do that is:

print '%s:%s:%s' % (now.hour, now.minute, now.second)

I assume this is your issue and you got the others right.


I have a question: https://www.codecademy.com/en/courses/python-beginner-c7VZg/4/3?curriculum_id=4f89dab3d788890003000096#

First, def a function called distance_from_zero, with one argument (choose any argument name you like).
If the type of the argument is either int or float, the function should return the absolute value of the function input.
Otherwise, the function should return "Nope"

My code is as follow, could you help me figure out the problem, thank u!

def distance_from_zero(thing):
if type(thing) = int or float
return absolute

    return "Nope"


Instead of "thing" as an argument to the "distance_from_zero" function, use "num". With this, you should use the "num" argument until the absolute return, ie "return abs (num)".

Then create the "if" statement, type with the argument ("type (num)"), which is equal to, "int or float" ("type (num) == int or type (num) == float ").

I hope you understood.


thank you, I did as follow, but it didn't work.

def distance_from_zero(num):
if type(num) == int or type(num) == float
return abs(num)

    return "Nope"

the error warning:
Oops, try again. It looks like you have a NameError. Maybe you forgot to create a function called distance_from_zero? Check the error message for more info! - global name 'distance_from_zero' is not defined


You changed the code order haha :smile:
It's all right just need to exchange one line of code for another!

def distance_from_zero(num):
    if type(num) == int or type(num) == float:
        return abs(num)   
        return "Nope"

print distance_from_zero(10)
print distance_from_zero(10.0)
print distance_from_zero(10.0)


print '%s/%s/%s %s:%s:%s' % (now.month, now.day, now.year, now.hour, now.minute, now.second)