Beispiel #1
0
plt.show()

# -------------------------------------------------------------------------------------------

# Import Decimal below:
from decimal import Decimal

# Fix the floating point math below:
two_decimal_points = Decimal('0.2') + Decimal('0.69')
print(two_decimal_points)

four_decimal_points = Decimal('0.53') * Decimal('0.65')
print(four_decimal_points)

# -------------------------------------------------------------------------------------------
# how to import from another file
# from file named library


def always_three():
    return 3


# from different file
# Import library below:
from library import always_three

# Call your function below:
print(always_three())
Beispiel #2
0
# Import library below:
from library import always_three


# Call your function below:
always_three()
print(randomer_number)

import codecademylib3_seaborn

# Add your code below:
from matplotlib import pyplot as plt
import random

numbers_a = range(1, 13)
numbers_b = random.sample(range(1000), 12)

plt.plot(numbers_a, numbers_b)

plt.show()

# Import Decimal below:
from decimal import Decimal

# Fix the floating point math below:
two_decimal_points = Decimal('0.2') + Decimal('0.69')
print(two_decimal_points)

four_decimal_points = Decimal('0.53') * Decimal('0.65')
print(four_decimal_points)

# Import library below:
from library import always_three

# Call your function below:
num = always_three()
Beispiel #4
0
# Import library below:
from library import always_three

# Call your function below:
always_three(2, 2, 2)
Beispiel #5
0
# Ch 7: Modules (Aug 17, 2019)
#	via 4. Modules Python Files and Scope
# 	using library.py as the example

# Import library below:
from library import always_three

# Call your function below:
n = always_three()
print(n)