<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>python on Terence Ponce&#39;s Website</title>
    <link>https://terenceponce.com/tags/python/</link>
    <description>Recent content in python on Terence Ponce&#39;s Website</description>
    <generator>Hugo -- gohugo.io</generator>
    <lastBuildDate>Wed, 03 Nov 2010 00:00:00 +0000</lastBuildDate><atom:link href="https://terenceponce.com/tags/python/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Introspection in Python</title>
      <link>https://terenceponce.com/posts/2010-11-03-introspection-in-python/</link>
      <pubDate>Wed, 03 Nov 2010 00:00:00 +0000</pubDate>
      
      <guid>https://terenceponce.com/posts/2010-11-03-introspection-in-python/</guid>
      <description>I just finished reading a chapter about Introspection in the book that I’m reading. Learning the concept of introspection and doing it in Python is the trickiest challenge I’ve come across so far.
Introspection, by definition, is determining and manipulating objects at runtime. The idea is that we know that there are objects that will definitely come across our program during run-time. We don’t know what they are exactly, but we want to do something about them in case our program encounters them.</description>
    </item>
    
    <item>
      <title>Python and its weird boolean logic</title>
      <link>https://terenceponce.com/posts/2010-11-02-python-and-its-weird-boolean-logic/</link>
      <pubDate>Tue, 02 Nov 2010 00:00:00 +0000</pubDate>
      
      <guid>https://terenceponce.com/posts/2010-11-02-python-and-its-weird-boolean-logic/</guid>
      <description>I found some pretty interesting keywords in Python: and and or. Coming from a C background, this is somehow new to me since I’m used to using symbolic operators for boolean logic (&amp;amp;&amp;amp; and ||). One of the things I noticed was how Python interprets these keywords:
1  &amp;#39;a&amp;#39; and &amp;#39;b&amp;#39;   It returns ‘b’. Surprised? I know I am. One look and I immediately thought it would return something similar to True since both values aren’t null.</description>
    </item>
    
    <item>
      <title>Python and its different way of type casting</title>
      <link>https://terenceponce.com/posts/2010-11-01-python-and-its-different-way-of-type-casting/</link>
      <pubDate>Mon, 01 Nov 2010 12:00:10 +0800</pubDate>
      
      <guid>https://terenceponce.com/posts/2010-11-01-python-and-its-different-way-of-type-casting/</guid>
      <description>I tried to make a Fibonacci program in Python to experiment with getting user input, displaying output and type casting. This was the code that I came up with at first:
1 2 3 4 5 6 7 8 9 10 11  def fib(n): print &amp;#39;n =&amp;#39;, n if n &amp;gt; 1: return fib(n - 1) + fib(n - 2) else: print &amp;#39;end of the line&amp;#39; return 1 n = raw_input(&amp;#39;Input number: &amp;#39;) int(n) fib(n)   When I tried running the program in the CLI, I have been successful in getting the user input.</description>
    </item>
    
    <item>
      <title>Optional Arguments, a gift from heaven</title>
      <link>https://terenceponce.com/posts/2010-11-01-optional-arguments-a-gift-from-heaven/</link>
      <pubDate>Mon, 01 Nov 2010 10:00:10 +0800</pubDate>
      
      <guid>https://terenceponce.com/posts/2010-11-01-optional-arguments-a-gift-from-heaven/</guid>
      <description>I’ve been messing around with functions in Python. One neat feature that I came across are optional arguments. Here’s some code that I’ve written to explain more about optional arguments:
1 2 3 4 5  def foo(length, bar = 5, foobar = 10): &amp;#34;&amp;#34;&amp;#34;A sample function demonstrating optional arguments. Takes 3 integer objects as its arguments&amp;#34;&amp;#34;&amp;#34; print &amp;#34;Length is %d\nBar is %d\nFoobar is %d\n&amp;#34; % (length, bar, foobar)   As with any other language out there, you can set default values for certain arguments in case they aren’t mentioned in a function call.</description>
    </item>
    
    <item>
      <title>The shortest &#39;Hello World&#39; ever</title>
      <link>https://terenceponce.com/posts/2010-11-01-the-shortest-hello-world-ever/</link>
      <pubDate>Mon, 01 Nov 2010 08:00:10 +0800</pubDate>
      
      <guid>https://terenceponce.com/posts/2010-11-01-the-shortest-hello-world-ever/</guid>
      <description>I decided to start learning Python recently. I figured I should try learning something new outside the C-family of languages (C, C++, Java, C#, etc) just for kicks. Python seems like the perfect language to make that transition that I want since it is somewhere between C and non-C in terms of syntax.
Since I have no idea how to start learning Python, I decided to ask a question on Programmers on Stack Exchange, which is a Q&amp;amp;A site that I visit most of the time.</description>
    </item>
    
  </channel>
</rss>
