Ejemplo n.º 1
0
from ecommerce.shipping import cal_shipping
import ecommerce.shipping
from ecommerce import shipping
from largestNumber import find_max
from class_practice_2 import *

numbers = [20, 2, 4, 12, 10]
number = find_max(numbers)
print(number)

ship = cal_shipping()
print(ship)

ecommerce.shipping.cal_shipping()
shipping.cal_shipping()

car1 = Car('Audi', 2018, 1980)
print(car1.detail())
print(car1.update_odometer(23500))
print(car1.increment_odometer(20))
print(car1.detail())

myCar = ElectricCar(1990, 'Tesla', 2019)
print(myCar.detail())
myCar.battery.describe_battery()
myCar.battery.get_range()
myCar.battery.upgrade_battery()
myCar.battery.get_range()
Ejemplo n.º 2
0
#exercise refer utils.py

from utils import find_max
numbers = [10,4,40,6,30]
print(find_max(numbers))

numbers = [10,4,40,6,30]
print(max(numbers))

# packages
import ecommerce.shipping
ecommerce.shipping.cal_shipping()
ecommerce.shipping.cal_tax()

from ecommerce.shipping import cal_shipping , cal_tax
cal_shipping()
cal_tax()

# Generating Random values
# ## refer python3 module index for built in module
import random
for i in range(3):
    print(random.random())

for i in range(3):
    print(random.randint(10,20))

members = ["john","Mary","jack","bob"]
leader = random.choice(members)
print(leader)
Ejemplo n.º 3
0
# ways to import module
import converters
from converters import append_hello

converters.append_hello("nirmesh")
append_hello("suresh")

# way to import package ecommerce
import ecommerce.shipping

# now access it
ecommerce.shipping.cal_shipping()

#or
from ecommerce.shipping import cal_shipping
cal_shipping()
#or
from ecommerce import shipping
shipping.cal_shipping()

import openpyxl as xl
from openpyxl.chart import BarChart, Reference

wb = xl.load_workbook("transactions.xlsx")
sheet = wb['Sheet1']
cell = sheet['a1']
#cell = sheet.cell(1,1)
#print(cell.value);

for row in range(2, sheet.max_row + 1):
    cell = sheet.cell(row, 3)
# CHECK ON THE MODULES FOR THE IMPORTED MODULES AND PACKAGES


## Python Modules
# Modules helps us organize code in multiple Files
# Each File is a module  
# create a new File / modelu to import from
# make sure Files are in the same folder 
# check the Modules Folder to upload



# import specific modules
from ecommerce.shipping import cal_shipping

cal_shipping() # now the method gets called.


# import all functions in a package
from ecommerce import shipping
shipping.customer_address()
shipping.cal_shipping()

# Central bank package fow cash payments and transactions
from banking import withdrawals
withdrawals.transactions(50000)
withdrawals.monthly_withdrawals(120000)



# check if path exists in a direcrtory
Ejemplo n.º 5
0
import ecommerce.shipping as f

d = f.cal_shipping()
print(d)