Latest web development tutorials

Python includes exercises 48

Python 100 Li Python 100 Li

Title: Comparative figures.

Program Analysis: None

Source Code:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

if __name__ == '__main__':
    i = 10
    j = 20
    if i > j:
        print '%d 大于 %d' % (i,j)
    elif i == j:
        print '%d 等于 %d' % (i,j)
    elif i < j:
        print '%d 小于 %d' % (i,j)
    else:
        print '未知'

The above example output is:

10 小于 20

Python 100 Li Python 100 Li