# AI News, Difference between revisions of "How to Think Like a Computer Scientist: Learning with Python 2nd Edition/Solutions"

## Difference between revisions of "How to Think Like a Computer Scientist: Learning with Python 2nd Edition/Solutions"

The following section contains answers to the exercises in the Book.

Why does a call to num_digits(-24) result in an infinite loop (hint: -1/10 evaluates to -1)?

The loop will end when n = 0, and per above -1/10 == -1, causing an infinite loop.

Encapsulate: in a function named count_letters, and generalize it so that it accepts the string and the letter as arguments.

Now rewrite the count_letters function so that instead of traversing the string, it repeatedly calls find (the version from Optional parameters), with the optional third parameter to locate new occurences of the letter being counted.

isleap(year) - Return 1 for leap years, 0 for non-leap years.

ceil function finds the lowest integeral value greater than or equal to x.

deepcopy would have come handy in exercises you didn't have to solve regarding object reference, thus no answer is excpected here.

The word 'alice' occurs 386 times (not including 12 occurences of 'alice's')

Java Programming Tutorial - 15 - Use Methods with Parameters

RL input lag tested - Rocket Science #13

All the raw data: FastSync (choose Rocket League as a profile instead of global if you only want it in RL): ..

2016 Isaac Asimov Memorial Debate: Is the Universe a Simulation?

What may have started as a science fiction speculation—that perhaps the universe as we know it is a computer simulation—has become a serious line of ...

Excel Magic Trick 913: Select From Drop Down and Pull Data From Different Sheet

Download workbook: See how to: 1. Select From Drop Down and Pull Data From Different Sheets using Data ..

Can You Solve This?

Can you figure out the rule? Did you see the exponents pattern? Why do you make people look stupid? How .

C Programming Tutorial - 42: Finding Prime Numbers

In this tutorial we are going to use nested loops to find prime numbers between 2 and 100.

The Greatest Integer Function

All about the greatest integer function.

Karan Johar In Conversation with Sadhguru - Live from Mumbai - June 4, 2017

Join us at 11am IST on June 4th for the next In Conversation with the Mystic In Conversation with the Mystic is an exclusive series of interactive episodes where ...

How do you find the HCF and LCM of 3 numbers?

To understand HCF and LCM better, please visit . Don't Memorise brings learning to life through its captivating FREE educational ..