def master(): print(""" ##################################################################### ### Master.py ### ##################################################################### # # # Hello, and welcome to the Master.py! # # # # With this simple file you will be able to navigate to any of the # # other Python projects. # # # # Simply type in the name of the project you would like to visit # # and press Enter. # # # ##################################################################### # # # Select from the following files: # # - hello.py # # - number_game.py # # - farts.py # # - list.py # # # ##################################################################### """) selection = input("Enter the name of a Python script you'd like to run: ") if selection == "hello.py": print(""" ##################################################################### ### hello.py ### ##################################################################### # # # hello.py is loading ... # # # ##################################################################### """) hello.hello_world() elif selection == "number_game.py": print(""" ##################################################################### ### number_game.py ### ##################################################################### # # # number_game.py is loading ... # # # ##################################################################### """) number_game.game() elif selection == "farts.py": print(""" ##################################################################### ### farts.py ### ##################################################################### # # # farts.py is loading ... # # # ##################################################################### """) print("farts.py") else: print("ERROR! Cannot find: ", selection) selection = None master()
from hello import hello_world risultato = hello_world() print risultato
import hello hello.hello_world('world')
def test_hello_pass(): assert hello.hello_world() == "Hello!"
def test_hello_word_is_string(): assert isinstance(hello_world(), str)
#Author:Fang hao #Time:2019/4/13 19:47 import hello hello.hello_world() from hello import hello_world hello_world() from hello import hello_world as say_hello_world say_hello_world() import hello as greeting greeting.hello_world() from hello import * hello_world()
import hello hello.hello_world() hello.hello("ABC") def my_cb(arg): print("Callback called from c") print(f"{str(arg)}") hello.set_callback(my_cb) hello.call_cb() def set_str(my_str): my_str += "kucing" c = "" set_str(c) print(c) a = {} a[1] = "b" hello.set_dict(a) print(a["response"]) print("finish")
def test_hello_name(): assert hello.hello_world("Ed") == "Hello, Ed!"
import hello import hello as hl from hello import hello_world from hello import * # hello.hello_world() # hl.hello_world() # hello_world() hello.hello_world()
def test_answer(): assert hello.hello_world() == 'hello world, my name is Alex Crosby'
def test_answer(): assert hello.hello_world() == 'hello world, my name is '
import hello print hello.hello_world()
def say_it(): hello.hello_world()
def test_hello_world(capfd): assert hello.hello_world() is None out = capfd.readouterr().out assert out == "Hello, world!\n"
from hello import hello_world assert hello_world() == 'Hello World'
import hello print(hello.hello_world())
def test_hello_world(self): greeting = hello_world("Hello World") self.assertEqual(greeting, "Hello World")
def test_says_hello(self): self.assertEqual(hello_world(), 'Hello from hello.py')
def test_hello(): assert hello.hello_world() == "Hello World!"
def test_hello_word_text(): assert hello_world() == 'Hello World!'
def test_hello_world(): expected = "Hello World" result = hello_world() assert expected == result