time - Best timing method in Python? -


i need assignment ,its first time computer science .please one. question.****type return statement: "return " followed expression performs calculation described in table above. (remember return statement used give value caller of function.) def seconds_difference(time_1, time_2):**** """ (number, number) -> number

return number of seconds later time in seconds  time_2 time in seconds time_1.  >>> seconds_difference(1800.0, 3600.0) 1800.0 >>> seconds_difference(1800.0, 3600.0) -1800.0 >>> seconds_difference(1800.0, 2160.0) 360.0 >>> seconds_difference(1800.0, 1800.0) 0.0 """ 

i wish best of luck in class. here's help:

def seconds_difference(first, second):     return second - first  print(seconds_difference(1800.0, 2160.0)) 

you should read functions:

http://anh.cs.luc.edu/python/hands-on/3.1/handsonhtml/functions.html


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -