'''
from random import *  # random is a library or module, * is the wildcard
import math  # imports go at the top of your program
from math import pi
# from math import *
import my_module

# when you use keyword from, you are importing directly into your file
# (no need to use random.randrange, just use randrange)

# Functions and Modules
print(randrange(900, 1000))
if __name__ == "__main__":
    '''
    This code only runs if this is the executed code/file. 
    '''
    print(randrange(100))
    print(random())
    print(pi)

    e = 5
    print(e)
    print("This is period", my_module.period)
    my_module.hello("Mr. Lee")
    product, sum = my_module.product_sum(10, 20)
    print(product, sum)

    print(3, 4, sep=",", end="")
    print(5, 6)
    my_module.hello(name="Francis")
    my_module.hello()
Пример #2
0
# Functions and Modules


if __name__ == "__main__":
    '''
    This code only runs if this is the executed code/file.
    '''
    print(randrange(100))
    print(random())
    print(pi)
    
    e = 5
    print(e)
    print("This is period", my_module.period)
    my_module.hello("Nathan")
    product, sum = (my_module.product_sum(10, 20))
    print(product, sum)

    print(3, 4, sep = "," , end = "")
    print(5, 6)

    my_module.hello(name = "Francis")
    my_module.hello()


for a in range(1, 10):
    for b in range(10):
        for c in range(10):
            for d in range(1, 10):
                num = str(a) + str(b) + str(c) + str (d)
Пример #3
0
import my_module

my_module.hello()

print(my_module.fib(3))
Пример #4
0
def test_hello(name):
    assert hello(name) == 'Hello, ' + name + '!'
Пример #5
0
def test_full_name_hello(first_name, last_name):
    full_name = first_name + ' ' + last_name
    assert hello(full_name) == 'Hello, ' + full_name + '!'
Пример #6
0
#!/usr/bin/env python3
import sys
import pprint

pprint.pprint(sys.path)
import my_module

my_module.hello("Ulrich")
print(dir())
print(dir(my_module))
'''

from random import * # random - star is the wild car(it means all)
#from math import *
from  math import pi
import my_module

# When you use the keyword from, you are importing directly into your file (no need to use random.randrange, just random)

# Functions and Modules
print(randrange(900, 1000))

if __name__ == "__main__":
    '''
    This code only runs if this is the executed code/file.
    '''
    print(randrange(100))
    print(random())
    print(pi)

    e = 5
    print(e)
    print("This is my period", my_module.period)
    my_module.hello("Simone")
    product, sum = my_module.product_sum(10, 20)
    print(product, sum)

    print(3, 4, sep = ",", end = "")
    print(5, 6)
    my_module.hello(name = "Francis")
    my_module.hello()
Пример #8
0
import my_module

print (my_module.foo)
my_module.hello()

print(my_module.__name__)


#Executing this script you will have
#> 100
#> i am from my_module.py
#> my_module