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

- On 4. oktober 2018
- By Read More

## 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.

choice = raw_input ('Please Enter a Function.') #had to ask about this, choice is raw input.

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')

- On 23. september 2021

**Java Programming Tutorial - 15 - Use Methods with Parameters**

Facebook - GitHub - Google+ .

**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): ..

**Excel Magic Trick 934: HYPERLINK Function and Hyperlink Feature (13 Examples)**

Download workbook: See how to use: 1) Hyperlink Feature to open a web address or file (Ctrl + K) 2) ..

**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 ..