-
Write a function
countdown
that takes a numbern
as input and prints the countdown fromn
to0
. -
The computer is way too fast. To a human observer, it would seem that all numbers in the countdown are printed at once. Figure out, using your favourite search engine, what can be done to add a delay in between numbers.
-
Modify the
yes
function so that it takes a numbern
and printsy
exactlyn
times.Remark: In the old days when everyone used to live inside the terminal, this
yes
function was used to automatically answer "yes" to all questions produced byprompt
. See theyes
program wikipedia entry. -
Suppose python didn't provide a multiplication operator. Show how to define a
mul
function that takes two numbers and returns its product. Themul
function should not use any multiplicative operators.
Created
January 28, 2021 06:42
-
-
Save balu/ef60f91681d7d92ff8e7a777faeb2fe9 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment