ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Review on PSAD 2.4
    카테고리 없음 2017. 5. 4. 17:23

    While I was studying Problem Solving with Algorithms and Data Structure using Python, I have found some interesting features on Python.


    1. Python has a ord()

    It is very interesting that there's a function returning a integer representing the Unicode code point of the character. Please have a look at this page for buit-in functions:

    https://docs.python.org/2/library/functions.html


    2. Declaring an array

    Unlike the other languages, Python declares and assigns an array using '*'. For example, c1 = [0]*26 declares an integer array c1 with size of 26.


    3. NameError: name 'Timer' is not defined

    If you encountered this error while you're running listing 3, you may have to put "from timeit import Timer" in front of your code.


    4. put print()

    In listing 4, there's no print() for popzero.timeit() and popend.timeit(). So, we need to put print() to see the green number results as in listing 4.



    댓글

Designed by Tistory.