#!/usr/bin/env python import helloworld helloworld.hello("World") helloworld.hello2("World")
def test_hello(): assert helloworld.hello() == 'Hello, World!'
def test_hello(self): self.assertEqual( helloworld.hello(1), "Hello")
#数组参数 def deduplication(self, nums): #找出排序数组的索引 for i in range(len(nums)): if nums[i] == self: return i i = 0 for x in nums: if self > x: i += 1 return i helloworld.hello('iechenyb 999') helloworld.print_func('iechenyb') cal = calendar.month(2016, 1) print("以下输出2016年1月份的日历:") print(cal) # 格式化成2016-03-20 11:45:39形式 print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) # 格式化成Sat Mar 28 22:24:24 2016形式 print(time.strftime("%a %b %d %H:%M:%S %Y", time.localtime())) # 将格式字符串转换为时间戳 a = "Sat Mar 28 22:24:24 2016" print(time.mktime(time.strptime(a, "%a %b %d %H:%M:%S %Y")))
import helloworld x = raw_input('Hit enter') if x == '': helloworld.hello()
# coding=utf8 from helloworld import hello hw = hello() hw.printHello() print('hello world')
#import the helloworld function #from helloworld import hello import helloworld #call funtion helloworld.hello()
def test_empty_arg(self): self.assertEqual(helloworld.hello(''), 'Hello World!')
def hello(request, lang="en"): cad = helloworld.hello(lang) # cad = helloworld.hello() return render_to_response('hello.html', locals())
def test_largename249(self): name = 'a'*249 with self.assertRaises(helloworld.Error): helloworld.hello(name)
def test_no_args(self): self.assertEqual(helloworld.hello(), 'Hello World!')
def test_largename248(self): name = 'a'*248 self.assertEqual(helloworld.hello(name), 'Hello {}!'.format(name))
def test_args(self): names = ['John', 'Jane', 'Jeff' 'J', '\n', '\t'] for name in names: self.assertEqual( helloworld.hello(name), 'Hello {}!'.format(name))
def test_hello(self): self.assertEqual(helloworld.hello(), 'Hello, World!')
def test_HelloWorld(capsys): hello() printed = capsys.readouterr() assert printed.out == "Hello World!\n"
def test_hello(): assert hello() == "Hello World!"
def test_hello(self): self.assertEqual("Hello World.", hello())
def test_hello_world(self): result = hello() self.assertEqual(result, 'hello')
#!/usr/bin/env python3 import helloworld print(helloworld.hello()); print(helloworld.heyman(5, "StarNight")); print(helloworld.add(5, 6)); help(helloworld);
#!/usr/bin/env python import helloworld, sys greeter = sys.argv[1] helloworld.hello(greeter) helloworld.hello2(greeter)
def test_hello(self): self.assertEqual(hello(), 'hello im chirchir')
def test1(): helloworld.hello("Tom")