This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-11-16 15:28:05

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Python

Is python cool?

Offline

 

#2 2010-11-16 15:30:00

Nexstudent
Scratcher
Registered: 2010-02-07
Posts: 1000+

Re: Python

what is python?


http://img696.imageshack.us/img696/9325/vedder.jpg

Offline

 

#3 2010-11-16 15:32:17

JeanTheFox
Scratcher
Registered: 2010-06-14
Posts: 1000+

Re: Python

Monty Python?


http://i51.tinypic.com/20gcn5j.png

Offline

 

#4 2010-11-16 15:39:38

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Python

Nexstudent wrote:

what is python?

He's a fictional sleazy television agent.


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#5 2010-11-16 16:04:17

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Python

the computer language

Offline

 

#6 2010-11-16 20:35:32

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: Python

Yeah, it is. I'm learning it.


http://i48.tinypic.com/2z5pqad.png

Offline

 

#7 2010-11-16 20:37:12

urhungry
Scratcher
Registered: 2009-07-03
Posts: 1000+

Re: Python

I prefer squeak, but yeah, python is cool. I just don't get it.

Offline

 

#8 2010-11-16 20:45:39

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Python

Yeah, it's pretty awesome, though I just started.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#9 2010-11-16 21:10:40

XplodingEggs
Scratcher
Registered: 2009-12-09
Posts: 100+

Re: Python

Yes, python is awesome, and I'm learning it.


http://i54.tinypic.com/102kqr7.jpg

Offline

 

#10 2010-11-16 21:16:46

drhelmi
Scratcher
Registered: 2008-10-01
Posts: 100+

Re: Python

I love Python!  big_smile  I once tried to learn Java, and I think I'm still missing a few brain cells. >_> I mean 'Hello world.' looks like this in Java.

Code:

class myfirstjavaprog
{  
        public static void main(String args[])
        {
           System.out.println("Hello World!");
        }
}

When in Python its just

Code:

print"Hello world."

Offline

 

#11 2010-11-16 21:17:35

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Python

Python is awesome. "A Byte of Python" is a great, in-depth guide.  big_smile


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#12 2010-11-16 21:25:14

urhungry
Scratcher
Registered: 2009-07-03
Posts: 1000+

Re: Python

drhelmi wrote:

I love Python!  big_smile  I once tried to learn Java, and I think I'm still missing a few brain cells. >_> I mean 'Hello world.' looks like this in Java.

Code:

class myfirstjavaprog
{  
        public static void main(String args[])
        {
           System.out.println("Hello World!");
        }
}

When in Python its just

Code:

print"Hello world."

This is true, but in python you have to import modulus, which I never understood how to do.

Offline

 

#13 2010-11-16 21:32:25

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Python

urhungry wrote:

drhelmi wrote:

I love Python!  big_smile  I once tried to learn Java, and I think I'm still missing a few brain cells. >_> I mean 'Hello world.' looks like this in Java.

Code:

class myfirstjavaprog
{  
        public static void main(String args[])
        {
           System.out.println("Hello World!");
        }
}

When in Python its just

Code:

print"Hello world."

This is true, but in python you have to import modulus, which I never understood how to do.

Code:

import module

Just replace "module" with whatever the name of the module is. For example:

Code:

import math

will import the "math" module that comes with Python. Then just use

Code:

module.function

to use whatever function you need that is contained in that module. So If you needed to find the square root of a variable and output the result, you could do this:

Code:

import math
num = int(input('Enter a number: '))
num = math.sqrt(num)
print num

http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#14 2010-11-17 08:21:00

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Python

I know Java! want help?

Offline

 

#15 2010-11-17 09:05:53

ob6160
Scratcher
Registered: 2010-10-10
Posts: 500+

Re: Python

Kileymeister wrote:

Nexstudent wrote:

what is python?

He's a fictional sleazy television agent.

Wrong! They were a group:
Monty Python (sometimes known as The Pythons)[2][3] were a British comedy group that created the influential Monty Python's Flying Circus, a British television comedy sketch show that first aired on the BBC  on 5 October 1969. Forty-five episodes were made over four series. The Python phenomenon developed from the television series into something larger in scope and impact, spawning touring stage shows, films, numerous albums, several books and a stage musical as well as launching the members to individual stardom. The group's influence on comedy has been compared to The Beatles' influence on music.[4][5]

The television series, broadcast by the BBC from 1969 to 1974, was conceived, written and performed by Graham Chapman, John Cleese, Terry Gilliam, Eric Idle, Terry Jones, and Michael Palin. Loosely structured as a sketch show but with an innovative stream-of-consciousness approach (aided by Gilliam's animation), it pushed the boundaries of what was acceptable in style and content.

A self-contained comedy team responsible for both writing and performing their work, they changed the way performers entertained audiences. The Pythons' creative control allowed them to experiment with form and content, discarding rules of television comedy. Their influence on British comedy has been apparent for years, while in North America it has coloured the work of cult performers from the early editions of Saturday Night Live through to more recent absurdist trends in television comedy. "Pythonesque" has entered the English lexicon as a result.

My fav's are:
Holy Grail
Life Of brian
How to irratate people.

The funniest in my opinion is John Cleese.

Best Regards

OB6160

http://upload.wikimedia.org/wikipedia/en/thumb/c/cb/Flyingcircus_2.jpg/275px-Flyingcircus_2.jpg

Bravely bold Sir Robin rode forth from Camelot
He was not afraid to die, O brave Sir Robin
He was not at all afraid to be killed in nasty ways
Brave, brave, brave, brave Sir Robin


He was not in the least bit scared to be mashed into a pulp
Or to have his eyes gouged out and his elbows broken
To have his kneecaps split and his body burned away
And his limbs all hacked and mangled, brave Sir Robin

His head smashed in and his heart cut out
And his liver removed and his bowels unplugged


   Well that's enough music for now, lads...

/ G - D - / / / /

Brave Sir Robin ran away - No!
Bravely ran away, away - I didn't!
When danger reared its ugly head
He bravely turned his tail and fled - No!
Yes, brave Sir Robin turned about
And gallantly he chickened out
Bravely taking to his feet
He beat a very brave retreat
Bravest of the brave, Sir Robin

Last edited by ob6160 (2010-11-17 09:08:29)


http://i45.tinypic.com/2jcygsy.gif

Offline

 

#16 2010-11-17 09:07:00

ob6160
Scratcher
Registered: 2010-10-10
Posts: 500+

Re: Python

Also try out Vb.net or C#.

Best Regards

OB6160


http://i45.tinypic.com/2jcygsy.gif

Offline

 

#17 2010-11-17 09:35:31

drhelmi
Scratcher
Registered: 2008-10-01
Posts: 100+

Re: Python

ProgrammingFreak wrote:

I know Java! want help?

Ugh. Thank you but no thank you. If I can program in Python, then thats all I need.  tongue  Thanks for the offer, though!
P.S. @Harakou, I noticed you used "input". Whats the difference in between that and "raw_input"?

Offline

 

#18 2010-11-17 17:26:10

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Python

drhelmi wrote:

ProgrammingFreak wrote:

I know Java! want help?

Ugh. Thank you but no thank you. If I can program in Python, then thats all I need.  tongue  Thanks for the offer, though!
P.S. @Harakou, I noticed you used "input". Whats the difference in between that and "raw_input"?

"raw_input" just produces a string, whereas "input" evaluates the expression. So if you were to use raw_input and entered in 56+3, it would return 56+3. "Input" would return 59.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#19 2010-11-17 17:31:43

MasterOfDeception
Scratcher
Registered: 2009-12-29
Posts: 100+

Re: Python

I program in python. I am not an expert, but I am pretty good and I'm taking a class.

Here is a fully fuctional deal of no deal program, but the banker formula is just the average of all the money on the board beacuse I can't find the right formula  sad  :

Code:

import time
import random
moneySetsList = [0.01,1,5,10,25,50,75,100,200,300,400,500,750,1000,5000,10000,25000,50000,75000,100000,200000,300000,400000,500000,750000,1000000]
moneySetsListCopy = [0.01,1,5,10,25,50,75,100,200,300,400,500,750,1000,5000,10000,25000,50000,75000,100000,200000,300000,400000,500000,750000,1000000]
caseOpen = 6
caseList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
dispCaseList = caseList[:]
moneyMix = []
for i in range (0, 26):
    mix = random.randint(0, len(moneySetsListCopy)-1)
    moneyMix.append(moneySetsListCopy[mix])
    moneySetsListCopy.remove(moneySetsListCopy[mix])
caseDict = dict(zip(caseList, moneyMix))
print('Welcome to Deal or no Deal!')
case = int(input('Select your case: '))
dispCaseList.remove(case)
moneySetsList.remove(caseDict[case])
while len(dispCaseList) > 1:
    print('In this round, you must open' ,caseOpen, 'cases')
    for i in range (0, caseOpen):
        print('This is the money table:' ,moneySetsList)
        print('')
        curr = int(input('Select a case. These are the cases left: ' +str(dispCaseList)+ ':'))
        print('')
        print('That case contained $'+str(caseDict[curr]))
        print('')
        dispCaseList.remove(curr)
        moneySetsList.remove(caseDict[curr])
    print('The banker is now going to make an offer')
    print('')
    print('The cases left are:' ,dispCaseList)
    print('')
    print('The money table is:' ,moneySetsList)
    print('Calling banker...')
    time.sleep(random.randint(1, 3))
    print('The banker has made his offer')
    time.sleep(1)
    print('His offer is...')
    bankOffer = round(sum(moneySetsList)/len(moneySetsList), 0)
    print('$'+str(bankOffer))
    print('So, with the banker offering $'+str(bankOffer)+'...')
    time.sleep(1)
    dond = input('Deal, or No Deal: ')
    if dond.lower() == 'deal':
        print('DEAL!')
        print('Congratulations, you are walking away with $' +str(bankOffer)+'!')
        print('Your case contained...')
        time.sleep(1)
        print('$' +str(caseDict[case]))
        dispCaseList = []
    else:
        print('NO DEAL!')
        if caseOpen > 1:
            caseOpen -= 1
print('There are only two cases left')
print('')
print('These are the cases left' ,dispCaseList)
print('')
print('This is the money table' ,moneySetsList)
print('')
print('The banker is offering $' +str(round(sum(moneySetsList)/len(moneySetsList), 0))+' for your case')
dond = input('Deal, or No deal: ')
if dond.lower() == 'deal':
    print('DEAL!')
    print('Congratulations, you are walking away with $' +str(bankOffer)+'!')
    print('Your case contained...')
    time.sleep(1)
    print('$' +str(caseDict[case]))
else:
    print('NO DEAL!')
    print("Congratulations, you are walking away with what's in your case")
    print('Your case contained...')
    time.sleep(1)
    print('$' +str(caseDict[case]))

Oh yah, this is in python 3.1.2 for anyone who is wondering.

Last edited by MasterOfDeception (2010-11-17 17:33:10)


"My Language Arts teacher beat Chuck Norris up." -12three

Offline

 

#20 2010-11-17 17:55:13

recycle49
Scratcher
Registered: 2009-12-21
Posts: 1000+

Re: Python

Blender runs off of it, its pretty cool


"Every challenge must be met, every battle must be won, and every story will end." -Me
Recycle49 December 09 - November 11 Goodbye

Offline

 

#21 2010-11-17 19:01:49

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Python

ob6160 wrote:

Kileymeister wrote:

Nexstudent wrote:

what is python?

He's a fictional sleazy television agent.

Wrong! They were a group:
Monty Python (sometimes known as The Pythons)[2][3] were a British comedy group that created the influential Monty Python's Flying Circus, a British television comedy sketch show that first aired on the BBC  on 5 October 1969. Forty-five episodes were made over four series. The Python phenomenon developed from the television series into something larger in scope and impact, spawning touring stage shows, films, numerous albums, several books and a stage musical as well as launching the members to individual stardom. The group's influence on comedy has been compared to The Beatles' influence on music.[4][5]

The television series, broadcast by the BBC from 1969 to 1974, was conceived, written and performed by Graham Chapman, John Cleese, Terry Gilliam, Eric Idle, Terry Jones, and Michael Palin. Loosely structured as a sketch show but with an innovative stream-of-consciousness approach (aided by Gilliam's animation), it pushed the boundaries of what was acceptable in style and content.

A self-contained comedy team responsible for both writing and performing their work, they changed the way performers entertained audiences. The Pythons' creative control allowed them to experiment with form and content, discarding rules of television comedy. Their influence on British comedy has been apparent for years, while in North America it has coloured the work of cult performers from the early editions of Saturday Night Live through to more recent absurdist trends in television comedy. "Pythonesque" has entered the English lexicon as a result.

My fav's are:
Holy Grail
Life Of brian
How to irratate people.

The funniest in my opinion is John Cleese.

Best Regards

OB6160

http://upload.wikimedia.org/wikipedia/e … rcus_2.jpg

Bravely bold Sir Robin rode forth from Camelot
He was not afraid to die, O brave Sir Robin
He was not at all afraid to be killed in nasty ways
Brave, brave, brave, brave Sir Robin


He was not in the least bit scared to be mashed into a pulp
Or to have his eyes gouged out and his elbows broken
To have his kneecaps split and his body burned away
And his limbs all hacked and mangled, brave Sir Robin

His head smashed in and his heart cut out
And his liver removed and his bowels unplugged


   Well that's enough music for now, lads...

/ G - D - / / / /

Brave Sir Robin ran away - No!
Bravely ran away, away - I didn't!
When danger reared its ugly head
He bravely turned his tail and fled - No!
Yes, brave Sir Robin turned about
And gallantly he chickened out
Bravely taking to his feet
He beat a very brave retreat
Bravest of the brave, Sir Robin

Wrong!  Well, wrong about me being wrong anyways.  I know what I'm dealing with.  Monty Python's Flying Circus was the television show, and Monty Python was the common name of their troupe, but Monty Python himself wasn't a real person, the title was created because they decided the show should be under the name of a cheesey television agent.  Eric Idle decided on Python, Cleese decided on Monty.

Also, you copied your entry off wikipedia I believe.

Last edited by Kileymeister (2010-11-17 19:05:20)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#22 2010-11-23 06:32:46

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Python

Kileymeister wrote:

ob6160 wrote:

Kileymeister wrote:


He's a fictional sleazy television agent.

Wrong! They were a group:
Monty Python (sometimes known as The Pythons)[2][3] were a British comedy group that created the influential Monty Python's Flying Circus, a British television comedy sketch show that first aired on the BBC  on 5 October 1969. Forty-five episodes were made over four series. The Python phenomenon developed from the television series into something larger in scope and impact, spawning touring stage shows, films, numerous albums, several books and a stage musical as well as launching the members to individual stardom. The group's influence on comedy has been compared to The Beatles' influence on music.[4][5]

The television series, broadcast by the BBC from 1969 to 1974, was conceived, written and performed by Graham Chapman, John Cleese, Terry Gilliam, Eric Idle, Terry Jones, and Michael Palin. Loosely structured as a sketch show but with an innovative stream-of-consciousness approach (aided by Gilliam's animation), it pushed the boundaries of what was acceptable in style and content.

A self-contained comedy team responsible for both writing and performing their work, they changed the way performers entertained audiences. The Pythons' creative control allowed them to experiment with form and content, discarding rules of television comedy. Their influence on British comedy has been apparent for years, while in North America it has coloured the work of cult performers from the early editions of Saturday Night Live through to more recent absurdist trends in television comedy. "Pythonesque" has entered the English lexicon as a result.

My fav's are:
Holy Grail
Life Of brian
How to irratate people.

The funniest in my opinion is John Cleese.

Best Regards

OB6160

http://upload.wikimedia.org/wikipedia/e … rcus_2.jpg

Bravely bold Sir Robin rode forth from Camelot
He was not afraid to die, O brave Sir Robin
He was not at all afraid to be killed in nasty ways
Brave, brave, brave, brave Sir Robin


He was not in the least bit scared to be mashed into a pulp
Or to have his eyes gouged out and his elbows broken
To have his kneecaps split and his body burned away
And his limbs all hacked and mangled, brave Sir Robin

His head smashed in and his heart cut out
And his liver removed and his bowels unplugged


   Well that's enough music for now, lads...

/ G - D - / / / /

Brave Sir Robin ran away - No!
Bravely ran away, away - I didn't!
When danger reared its ugly head
He bravely turned his tail and fled - No!
Yes, brave Sir Robin turned about
And gallantly he chickened out
Bravely taking to his feet
He beat a very brave retreat
Bravest of the brave, Sir Robin

Wrong!  Well, wrong about me being wrong anyways.  I know what I'm dealing with.  Monty Python's Flying Circus was the television show, and Monty Python was the common name of their troupe, but Monty Python himself wasn't a real person, the title was created because they decided the show should be under the name of a cheesey television agent.  Eric Idle decided on Python, Cleese decided on Monty.

Also, you copied your entry off wikipedia I believe.

this is talking about the programing language

Offline

 

#23 2010-11-23 06:34:57

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Python

i think python is a little hard.  I'm following online instructions, but i have bugs  sad

Offline

 

#24 2010-11-23 18:32:39

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Python

scimonster wrote:

i think python is a little hard.  I'm following online instructions, but i have bugs  sad

Try A Byte of Python.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer