Beispiel #1
0
        print(a**b)
#Input
##How we take input and work with it
name = input('enter your input: ')
print('hello', name)

#import
## this creates a shortcut for the word statistics(s)
## import statistics as s

## from statistics import mean as m,stdev as std
## imports statistics module
## nicknames mean as 'm', stdev as 's'

from statistics import *
##this imports ALL functions of the stat module as quick functions

exList = [4,8,15,16,23,42,0,0,0]

print(mean(exList))
print(stdev(exList))

import newModule

userDave = ['dave','penny']

newModule.password(userDave[0],userDave[1])
#remember to do this with the MODULENAME.FUNCTION NAME format
import exampleMod
exampleMod.fish('and here it is too!')
Beispiel #2
0
#Modules
##Rule number one is "Don't repeat yourself!" So use Modules to bring in all the crap people have done so you don't have to.
##All major modules are going to be available through 'pip'

from newModule import password

password('leslie','waffles')

##For Modules, it's probably easiest to give your modules/methods some pretty specific and unique names
##That's also a good way to check for issues

import sys

print(sys.path)