
Python is a FREE program that is 100% coding. Now, download it here.
NOTE: For those who want to test, go to Options, then Configure IDLE. Then go to "General". For the startup, click "Open Edit"
So, lets get started on the easiest thing... 'Hello World'
HELLO WORLD
So I will break up the code.
Line 1:
#This program says hello and asks for my name.
Line 2:
print('Hello world!')Line 3:
print('What is your name?')Line 4:
myName = input()
Line 5:
print('It is good to meet you, ' + myName)
USING PYTHON FOR MATH
This is very simple. Here is something EASY:
5 + 5
It would say "10".
So, next is a cool way to do math!
Here is a sample code:
Scratch = 4947284244676486189461874 MIT = 5
So, lets do a problem:
Scratch + MIT
and the result is...
4947284244676486189461879

Expect more Python coding soon! Keep looking for updates!
Our other forum post: here!
Our website: pylibrary.co.cc Our Wiki: wiki.pylibrary.co.cc
Offline
scratcher7_13 wrote:
Cool!
Yes, I would like to thank Scratch. And 000webhost for the website!
Offline
Reminds me of C64 basic.
Offline
bananaman114 wrote:
Reminds me of C64 basic.
You remember the C64! Wow!
Offline
johnnydean1 wrote:
bananaman114 wrote:
Reminds me of C64 basic.
You remember the C64! Wow!
What is the C64?
Offline
Is it my imagination or did we talk about that div bar?
Offline
scimonster wrote:
Is it my imagination or did we talk about that div bar?
I reported the posts.
Offline
PythonLibrary wrote:
johnnydean1 wrote:
bananaman114 wrote:
Reminds me of C64 basic.
You remember the C64! Wow!
What is the C64?
Commodore 64. Google it. I own 1.
Offline
looks good.
Offline
def showStatue():
tortoise.forward(150)
printNow("Tortoise crawls north into a large chamer.")
printNow("A large statue of the World Turtle occupies much of the room.")
printNow("All of a sudden, the statue shatters!")
printNow("Underneath the statue was a tunnel!")
direction = requestString("Would you like to go down or south?")
if direction == "down":
showCave()
if direction == "south":
showGate()
if direction == "quit":
printNow("Goodbye!")
def showGate():
tortoise.forward(10)
printNow("You are back at the World Turtle temple gates.")
direction = requestString("Would you like to go north or west?")
if direction == "north":
showStatue()
if direction == "west":
showColumns()
if direction == "quit":
printNow("Goodbye!")
def showColumns():
turn(tortoise, -90)
tortoise.forward(-60)
printNow("Tortoise crawls over to a ledge on the temple wall.")
printNow("He sees several large Columns.")
printNow("He hears a boom in the main chamber, and the columns fall down!")
printNow("There is now a north-east facing passage to the main chamber!")
turn(tortoise, 90)
direction = requestString("Would you like to go east or north-east?")
if direction == "east":
showGate()
if direction == "north-east":
printNow("Oh no! The tunnel is collapsing!")
printNow("Tortoise emerges out of the collapsing tunnel just in time!")
showStatue()
if direction == "quit":
printNow("Goodbye!")
def showCave():
tortoise.forward(-50)
printNow("Tortoise falls down a deep chasm, and lands with a thump at the bottom.")
printNow("The outside world is now just a speck of light far above.")
printNow("Tortoise looks around and shudders. Pools of blood and turtle soup litter the ground.")
printNow("Tortoise hears a thump and a scream further down the tunnel.")
direction = requestString("Would you like to go forward or up?")
if direction == "up":
tortoise.forward(40)
printNow("Tortoise begins scaling the walls.")
printNow("He gets up legitemately far, but the walls become to steep for his stubby turtle legs!")
printNow("OH HO! Tortoise falls down! Guess that wall is too steep.")
tortoise.forward(-40)
showCave()
if direction == "forward":
showLair()
if direction == "quit":
printNow("Goodbye!")
def showLair():
printNow("Tortoise runs to the end of the tunnel, where he discovers Terrapin - in a cage!")
tortoise.forward(70)
terrapin = makeTurtle(turtleland)
print terrapin
penUp(terrapin)
printNow("But between Tortoise and Terrapin is a Human!!")
terrapin.forward(-30)
printNow("Tortoise notices that the human is standing on a trapdoor.")
button = requestInteger("There are two buttons. Which one do you press - 1 or 2?")
if button == 1:
printNow("You guessed right! The human screams and falls down into the abyss!!")
penDown(terrapin)
terrapin.turn(90)
terrapin.forward(90)
terrapin.turn(-90)
penUp(terrapin)
printNow("Tortoise walks up to the cage and notices a key. It fits the cage!")
printNow("Freed, terrapin tells his tale...")
terrapin.forward(100)
tortoise.forward(20)
printNow("'That human is working for Snapping Turtle's mob.'")
printNow("'They are expirementing on a serum to mind-control turtles.'")
printNow("'If they succeed, all of Turtleland will be under Snapping Turtle's control!'")
printNow("'That trapdoor leads to a chamber. It's a steep drop, but there's a ladder.'")
direction = requestString("Would you like to go down or back?")
if direction == "down":
showLadder()
if direction == "back":
showCave()
if direction == "quit":
printNow("Goodbye!")
if button == 2:
printNow("OH NO! You didn't guess right!")
printNow("Tortoise falls down to his doom, his screams echoing throughout the temple.")
tortoise.forward(-100)
tortoise.setVisible(false)
printNow("GAME OVER")
def showLadder():
printNow("The ladder is better suited to humans, but it works just fine for Tortoise.")
tortoise.forward(-70)
printNow("Tortoise sees two passeges; a metallic hi-tech one to the right, and a carved ancient one to the left.")
direction = requestString("Would you like to go left or right?")
if direction == "left":
showPassage()
if direction == "right":
showTunnel()
if direction == "quit":
printNow("Goodbye!")
def showPassage():
tortoise.forward(50)
printNow("The tunnel is filled with ancient carvings.")
printNow("Torches flicker on the walls. Tortoise notices a strange glittery glow from the other room.")
direction = requestString("Would you like to go forward or back?")
if direction == "back":
showLadder()
if direction == "forward":
showCrypt()
if direction == "quit":
printNow("Goodbye!")
def showCrypt():
printNow("Tortoise gasps in suspride. This is the fabled tomb of the fabled King of the Sea Turtles!")
tortoise.backward(12)
crystal = requestString("There is a glistening nebula-like crystal by the tomb. Do you touch it? Yes or no.")
if crystal == "yes":
tortoise.backward(-12)
printNow("The whole tomb shakes!")
printNow("The huge sarcophogus shakes and shatters, revealing...")
king.forward(200)
king.setVisible(true)
throwaway = makeTurtle(turtleland)
throwaway.setVisible(true)
penUp(throwaway)
throwaway.backward(700)
printNow("The Sea Turtle King!")
printNow("The sea turtle king hears the tale of Tortoise's quest and wishes to help him save Turtleland.")
if crystal == "no":
printNow("Nothing happens.")
if crystal == "quit":
printNow("Goodbye!")
direction = requestString("There are no other ways out but going back(type 'back').")
if direction == "back":
showPassage()
if direction == "quit":
printNow("Goodbye!")
def showTunnel():
printNow("This tunnel is very hi-tech. Computer screens paper the walls.")
printNow("At the end is a panel that looks like it scans hands or turtle claws.")
scanner = requestString("Do you put your hand on it? Yes or no.")
if scanner == "yes":
printNow("Oops! The scanner didn't recognize Tortoise's claw!")
printNow("A laser beam shoots out of the scanner and turns Tortoise into turtle soup.")
tortoise.setVisible(false)
printNow("GAME OVER")
if scanner == "no":
printNow("Hey, look! Tortoise found a big red button!")
printNow("It reads 'SECURITY OVERRIDE'.")
printNow("Tortoise pushes it.")
printNow("The security failed! The door opens.")
direction = requestString("Would you like to go forward or back?")
if direction == "back":
showLadder()
if direction == "forward":
showLab()
if direction == "quit":
printNow("Goodbye!")
if scanner == "quit":
printNow("Goodbye!")
def showLab():
snapper = makeTurtle(turtleland)
print snapper
printNow("It's Snapping Turtle!")
printNow("Snapping Turtle drops a bundle marked 'mind control serum'.")
printNow("Snapping Turtle begins loading it onto a plane.")
attack = requestString("Do you challenge him for it?")
if attack == "quit":
printNow("Goodbye!")
if attack == "no":
printNow("Uh-oh! Tortoise loses his balance and falls over, making a noise. His cover is blown!")
printNow("Snapping Turtle turns around and snarls. He pushes a button.")
printNow("A clock begins beeping as Snapping Turtle flies away. The plane begins spraying the serum, and the temple explodes!")
tortoise.setVisible(false)
printNow("GAME OVER")
if attack == "yes":
printNow("Tortoise charges a Snapping Turtle!")
turtles = len(getTurtleList(turtleland))
if turtles == 5:
printNow("Snapping Turtle catches Tortoise mid-leap. THIS COULD BE THE END!")
turnToFace(snapper, tortoise)
snapper.forward(100)
printNow("But, come to the rescue is Sea Turle King!")
turnToFace(king, snapper)
penDown(king)
king.forward(200)
printNow("Snapping Turtle catches a face full of sea Turtle King fist and flies into the plane's propeller!")
printNow("Congratulations! You won!")
if turtles == 4:
printNow("As Tortoise leaps, Snapping Turtle turns around. He opens his snapping turtle jaws and chomps down!")
tortoise.setVisible(false)
printNow("GAME OVER")
turtleland = makeWorld()
tortoise = makeTurtle(turtleland)
king = makeTurtle(turtleland)
print tortoise
print king
penUp(king)
king.setVisible(false)
king.backward(700)
penUp(tortoise)
printNow("Welcome to the Tortoise Adventure game!")
printNow("The turtle you see in the World window is Tortoise.")
printNow("Watch the World; Tortoise moves!")
printNow("If at any time you wish to exit, type quit in the answer section of the prompt dialogs.")
printNow("Tortoise's best friend Terrapin has gone missing.")
printNow("Tortoise decides to find him, and begins a search through all of Turtleland.")
printNow("He finds himself at the gates of the World Turtle temple.")
direction = requestString("Would you like to go north or west?")
if direction == "north":
showStatue()
if direction == "west":
showColumns()
if direction == "quit":
printNow("Goodbye!")This is JES code for a turtle adventure game.
Offline