Ejemplo n.º 1
0
# -*- coding: UTF-8 -*-
__author__ = 'admin'
import os, sys


j = 3

j = 3
j = 3

# def printi():
#    i = 2
#    while (i <= 100):
#        print i
#        print u"你好,世界~!!!"
#        i += 2

if __name__ == "__main__":
    dict1 = {'name':123,'age':24,'city':'shanghai',2:3435,'salr':24555}
    print dict1
    print dict1[2]
    print dict1.keys()
    print dict1.values()
    print dict1['name']
    print dict1[2],dict1['name']


from module1 import printname
printname('test')

Ejemplo n.º 2
0
# -*- coding: UTF-8 -*-
__author__ = 'admin'

import sys, math, os
import module1

j = 3
i = 2

j = 3
i = 2

for i in range(2, 100):
    x = 'foo'
    if i % 2 == 1:
        sys.stdout.write(x + '\n' + str(i) + x)
        module1.printname(x)
        i += 1
    else:
        sys.stdout.write(x + '\n' + str(i))
        i += 1
Ejemplo n.º 3
0
j = 3

j = 3
j = 3

# def printi():
#    i = 2
#    while (i <= 100):
#        print i
#        print u"你好,世界~!!!"
#        i += 2

if __name__ == "__main__":
    dict1 = {
        'name': 123,
        'age': 24,
        'city': 'shanghai',
        2: 3435,
        'salr': 24555
    }
    print dict1
    print dict1[2]
    print dict1.keys()
    print dict1.values()
    print dict1['name']
    print dict1[2], dict1['name']

from module1 import printname
printname('test')