Beispiel #1
0
import cat as tom

tom.purr('kitty')
tom.lick('kitty')
tom.nap('kitty')
Beispiel #2
0
import cat
pet = input('Enter a pet Name:')

cat.purr(pet)
cat.nap(pet)
cat.lick(pet)



Beispiel #3
0
#Next, add two more function definitions that also supply
#default string values to their arguments for displat
def lick(pet = 'A Cat'):
    print(pet, 'Drinks Milk')

def nap(pet = 'A Cat'):
    print(pet, 'Sleeps By The Fire')

#Start a new Python script with the statement to make the
#"cat" module functions available
import cat

#Next, call each function without supplying an argument
cat.purr()
cat.lick()
cat.nap()

#Now, call each function again and pass an argument to
#each, then save the file
cat.purr('Kitty')
cat.lick('Kitty')
cat.nap('Kitty')

#Start another Python script by making the "cat" module
#functions available once more
import cat

#Then, request the user enters a name to overwrite the
#default argument value
pet = input('Enter A Pet Name:')
Beispiel #4
0
import cat

cat.purr()
cat.lick()
cat.nap()

cat.purr('Kitty')
cat.lick('Kitty')
cat.nap('Kitty')
Beispiel #5
0
import cat

cat.purr()
cat.lick()
cat.nap()

cat.purr("Kitty")
cat.lick("Kitty")
cat.nap("Kitty")

Beispiel #6
0
from cat import lick, nap, purr
pet = input('Enter a pet name:')
purr(pet)
lick(pet)
nap(pet)
Beispiel #7
0
# coded utf-8
# python ver. 3.7

import cat as tiger

pet = input('Enter a pet name: ')

tiger.purr(pet)
tiger.lick(pet)
tiger.nap(pet)
import cat

cat.purr()
cat.lick()
cat.nap()
Beispiel #9
0
import cat

cat.purr()
cat.lick()
cat.nap()

cat.purr('kitty')
cat.lick('kitty')
cat.nap('kitty')
import cat as tom

pet= input("Enter a pet name:- ")

tom.purr(pet)

tom.lick(pet)

tom.nap(pet)

Beispiel #11
0
# To create alias for importing module
import cat as dog # Here I am creating alias to cat as dog
# Pass Function without any argument
dog.purr()
dog.lick()
dog.nap()
# Now pass function with arguments
dog.purr('Kitty')
dog.lick('Kitty')
dog.nap('Kitty')