def test_hello(self): self.assertEqual(hello(), 'Hello World')
def test_hello(self): netid = code.netid str = code.hello() self.assertTrue(str[:6] == "Hello ") self.assertTrue(str[6:] == netid)
import code num = int(input('Give me a number!')) code.single_row_stars(num) code.rewrite(6) print('Hello!') day_number = code.today() print('Today is ' + str(day_number) + ' in the month.') a = input('What is your name? ') code.hello(a) b = input('And how is your friend called? ') code.hello2(a, b) r = float(input('what is the radius?')) z = code.circle_area(r) print('the are is ' + str(z))
print("Hello! " + a_name) def hello2(name_a, name_b): print("Hello! " + name_a + " and " + name_b) def sum_two(x, y): z = x + y return z import code a_name = input("What is your name?") code.hello(a_name) name_a = input("What is your name?") name_b = input("What about your mates name?") code.hello2(name_a, name_b) import math def circle_area(radius): y = radius**2 * math.pi return y print(circle_area(2)) #wenn man diesen code importiert: z = code.circle_area(2) danach print(z) oder print(code.circle_area(2))
def test_hello(self): self.assertTrue(code.hello(), "world")
from code import hello assert hello() == 'hello, world', 'Функция возвращает неверное значение'