Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Working with functions | Introduction to Jupyter notebook
Introduction to Jupyter notebook: Python

book
Working with functions

In the same way as with variables, you can declare your own functions and then use them in the notebook.

Compito

Swipe to start coding

  1. Replace ... with the necessary calculation. Remember, your function needs to convert number of seconds to days.
  2. Replace ... with the name of function and name of variable you created before.

Soluzione

# create function
def days_from_second(sec):
return(sec/86400)

# test function
print("There are",days_from_second(sec_in_week),"days in", sec_in_week, "seconds")

Mark tasks as Completed
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 3
single

single

taskCode

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt