Nexstudent wrote:
what is python?
He's a fictional sleazy television agent.
Offline
I love Python!
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.
class myfirstjavaprog
{
public static void main(String args[])
{
System.out.println("Hello World!");
}
}When in Python its just
print"Hello world."
Offline
drhelmi wrote:
I love Python!
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
urhungry wrote:
drhelmi wrote:
I love Python!
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.
import module
Just replace "module" with whatever the name of the module is. For example:
import math
will import the "math" module that comes with Python. Then just use
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:
import math
num = int(input('Enter a number: '))
num = math.sqrt(num)
print numOffline
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![]()
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)

Offline
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.
Thanks for the offer, though!
P.S. @Harakou, I noticed you used "input". Whats the difference in between that and "raw_input"?
Offline
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.
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.
Offline
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
:
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)
Offline
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)
Offline
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 RobinWrong! 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
i think python is a little hard. I'm following online instructions, but i have bugs
Offline
scimonster wrote:
i think python is a little hard. I'm following online instructions, but i have bugs
![]()
Try A Byte of Python.
Offline