You are Here:
People Who know how to use Python!

Author (Read 1670 times)

People Who know how to use Python!
« on: March 19, 2012, 08:35:14 PM »
 

Joshua Robinson

  • Former Moderator
  • Extraordinaire
  • *
  • 1,060
    Posts
  • Reputation: 30
  • grow. create. live.

  • Facebook:

  • Skype:

  • Twitter:

  • Windows Live:

  • YouTube:
In out ICT class, we have been given homework with Python:

"begin to compile a working dictionary/reference for what it is you know about python. If you are in first semester of python, you need to provide 40 keywords, terms and operators and 'types' that you know how to use. If you are in your second semester, you need to provide 80 terms, operators and keywords and types that you use.

Each entry should have an example,(python code) as well as an explanation of what is going on (comments in the code)"

that is what I have to do, I'm In the FIRST SEMESTER! please help, I only need forty and I am not good at Python AT ALL!

Please, Please, Please help!
I am now a Business Representative for www.shuffleanddeal.com.au

Youtube channel for Shuffle and Deal: http://www.youtube.com/user/ShuffleAndDealAus?feature=mhee
 

Re: People Who know how to use Python!
« Reply #1 on: March 19, 2012, 09:00:15 PM »
 

Kanped

  • Frequent Flyer
  • *
  • 894
    Posts
  • Reputation: 29

  • Facebook:
Well, I REALLY think it would be of no use whatsoever to do this for you; you only learn programming (and Python could be very useful- it's a great place to start) by actually practising and doing it (getting you to name keywords seems a bit redundant, though).

However, it really shouldn't be hard; operators can be as simple as + or - (or =, < etc. etc.).

You'll find everything you need here;

http://docs.python.org/library/

but if you actually want to understand any of it, try a few tutorials.  Then modify them, or extend them.  Trust me, this stuff is WORTH DOING.  It can be good fun, too.  Work your way through some of this;

http://docs.python.org/tutorial/



« Last Edit: March 19, 2012, 09:00:39 PM by Kanped »
 

Re: People Who know how to use Python!
« Reply #2 on: March 20, 2012, 01:18:05 AM »
 

Don Boyer

  • VP/Dir. Club Forum/DAC Chair, 52 Plus Joker
  • Administrator
  • Forum Sentinel
  • *
  • 19,172
    Posts
  • Reputation: 415
  • Pick a card, any card...no, not THAT card!

  • Facebook:
Well, I REALLY think it would be of no use whatsoever to do this for you; you only learn programming (and Python could be very useful- it's a great place to start) by actually practising and doing it (getting you to name keywords seems a bit redundant, though).

However, it really shouldn't be hard; operators can be as simple as + or - (or =, < etc. etc.).

You'll find everything you need here;

http://docs.python.org/library/

but if you actually want to understand any of it, try a few tutorials.  Then modify them, or extend them.  Trust me, this stuff is WORTH DOING.  It can be good fun, too.  Work your way through some of this;

http://docs.python.org/tutorial/

As a kid, I started programming in BASIC and just scratched the surface of COBOL before moving to another school.  This was in the pre-DOS days; Windows wasn't even on Bill Gates radar yet, likely because Xerox PARC hadn't finished developing it yet!  In fact, the first Macintosh computer didn't even come out until about four years after I started learning!  I used the TRS-80 Models I and III and the Apple II and IIc.  The Apple IIc was amazing stuff at the time - it was the first COLOR computer I'd laid my hands on...  And the "Trash-80s" didn't even have 5.25" floppy disc drives yet - they'd only recently been invented and were too costly.  You don't even wanna know what we had to do for program storage and loading...  My analog watch probably has more computing power than the Trash-80s, and my cellphone can run circles around all four of them combined.

How solid/useful is Python?  What can you do with it?
Card Illusionist, NYC Area
Playing Card Design & Development Consultant
Deck Tailoring: Custom Alterations for Magicians and Card Mechanics
Services for Hire - http://thedecktailor.com/
Pre-Made Decks for Sale - http://donboyermagic.com/
 

Re: People Who know how to use Python!
« Reply #3 on: March 20, 2012, 05:02:51 AM »
 

Kanped

  • Frequent Flyer
  • *
  • 894
    Posts
  • Reputation: 29

  • Facebook:
AFAIK, Python is a bit like a C++ alternative; it still uses all the C syntax but has its own libraries and extensions and general is easier to learn than C++ (thank god). 
I've heard it described as an alternative to Perl for web-based programming.  I guess it can do anything C can do, with a good few extensions over that.  I know hackers like it, so you know the functionality is good off the back of that and I've heard it from people I respect; 'They should teach Python to beginners, not Java'.  I dunno, I started with VB and then learned Java, 68k ASM and C#.  I tried and failed to learn C++.  I'd chalk it down to poor teaching, though; I will go back to it and learn it properly at some stage.
« Last Edit: March 20, 2012, 05:06:57 AM by Kanped »
 

Re: People Who know how to use Python!
« Reply #4 on: March 20, 2012, 11:01:39 AM »
 

AceGambit

  • Discourse Lover
  • *
  • 225
    Posts
  • Reputation: 35
  • mundus vult decepi
AFAIK, Python is a bit like a C++ alternative; it still uses all the C syntax but has its own libraries and extensions and general is easier to learn than C++ (thank god). 

While my personal opinion is that C++ is the devil, it has something python doesn't use... braces.  In C++ you get something that looks like this
Code: [Select]
int x = 10;
if(x > 5)
{
   x = x + 4;
}

As a professional programmer, the same concept in python makes me cry
Code: [Select]
x = 10
if x > 5 :
    x = x + 4

python's interpretation of source code relies exclusively on the indentation of your code, and you don't have to declare any of your variables /cry
They say the greatest trick the devil ever pulled, was convincing the world that he didn't exist.
 

Re: People Who know how to use Python!
« Reply #5 on: March 21, 2012, 12:38:02 PM »
 

Kanped

  • Frequent Flyer
  • *
  • 894
    Posts
  • Reputation: 29

  • Facebook:
Yeah, I've come across that before and while I generally don't like it, it depends on the IDE.  The 68k emulator I was using had indented reliant coding but it was also colour-coded, so it was really easy to see what was going on, regardless.

Loose typing can be very useful but if the compiler is anything less than spectacular, you will run into many very irritating problems IMO.  Oddly, in C++, you can declare an int and later use it as a float (for example) without any troubles, or parsing at all so there's no real reason to declare the variables IMO.  The only trouble with Python I can see is, what if you want the character 9 and not the integer value 9?  How does it do that?

Also, that's a strange little piece of code you've written... is it from a specific program?  Does it have any utility at all, or was i just off the top of your head?
 

Re: People Who know how to use Python!
« Reply #6 on: March 21, 2012, 02:11:07 PM »
 

AceGambit

  • Discourse Lover
  • *
  • 225
    Posts
  • Reputation: 35
  • mundus vult decepi
No, it's not from any specific program, it's just some random code i made.  It doesn't actually do anything useful at all.  I was just using it because it had a variable declaration/assignment, and a conditional.

Also, I presume if you wanted the integer 9 you would type x=9, where as if you wanted the character literal 9 you would type x='9'.  In nearly every programming language I've ever used, integers are as is ( 9 ), character literals are enclosed in single quotes ( '9' ), and string literals are enclosed in double quotes ( "9" ).
« Last Edit: March 21, 2012, 02:13:13 PM by AceGambit »
They say the greatest trick the devil ever pulled, was convincing the world that he didn't exist.
 

Re: People Who know how to use Python!
« Reply #7 on: March 21, 2012, 10:26:00 PM »
 

Don Boyer

  • VP/Dir. Club Forum/DAC Chair, 52 Plus Joker
  • Administrator
  • Forum Sentinel
  • *
  • 19,172
    Posts
  • Reputation: 415
  • Pick a card, any card...no, not THAT card!

  • Facebook:
Man, I miss programming...  Didn't realize how much until I heard those last few posts.
Card Illusionist, NYC Area
Playing Card Design & Development Consultant
Deck Tailoring: Custom Alterations for Magicians and Card Mechanics
Services for Hire - http://thedecktailor.com/
Pre-Made Decks for Sale - http://donboyermagic.com/
 

Re: People Who know how to use Python!
« Reply #8 on: March 21, 2012, 11:51:02 PM »
 

AceGambit

  • Discourse Lover
  • *
  • 225
    Posts
  • Reputation: 35
  • mundus vult decepi
Man, I miss programming...  Didn't realize how much until I heard those last few posts.
You should totally get back into it!  There's a reason I do it for a living.  Someone once told me "find someone who will pay you for your hobby and you'll never work a day in your life."

How long has it been since you were last into programming?  GW-Basic?  Q-Basic? VB? Or did you manage to slip into my world?  The world of .NET?
They say the greatest trick the devil ever pulled, was convincing the world that he didn't exist.
 

Re: People Who know how to use Python!
« Reply #9 on: March 22, 2012, 02:47:03 PM »
 

NathanCanadas

  • King of Hearts
  • *
  • 2,767
    Posts
  • Reputation: 65
  • Check out my sales post in my signature!

  • YouTube:
Man, I miss programming...  Didn't realize how much until I heard those last few posts.
Well, I REALLY think it would be of no use whatsoever to do this for you; you only learn programming (and Python could be very useful- it's a great place to start) by actually practising and doing it (getting you to name keywords seems a bit redundant, though).

However, it really shouldn't be hard; operators can be as simple as + or - (or =, < etc. etc.).

You'll find everything you need here;

http://docs.python.org/library/

but if you actually want to understand any of it, try a few tutorials.  Then modify them, or extend them.  Trust me, this stuff is WORTH DOING.  It can be good fun, too.  Work your way through some of this;

http://docs.python.org/tutorial/

As a kid, I started programming in BASIC and just scratched the surface of COBOL before moving to another school.  This was in the pre-DOS days; Windows wasn't even on Bill Gates radar yet, likely because Xerox PARC hadn't finished developing it yet!  In fact, the first Macintosh computer didn't even come out until about four years after I started learning!  I used the TRS-80 Models I and III and the Apple II and IIc.  The Apple IIc was amazing stuff at the time - it was the first COLOR computer I'd laid my hands on...  And the "Trash-80s" didn't even have 5.25" floppy disc drives yet - they'd only recently been invented and were too costly.  You don't even wanna know what we had to do for program storage and loading...  My analog watch probably has more computing power than the Trash-80s, and my cellphone can run circles around all four of them combined.

How solid/useful is Python?  What can you do with it?
Man do you make me think of my dad! (no offense)
 

Re: People Who know how to use Python!
« Reply #10 on: March 24, 2012, 01:09:04 AM »
 

Don Boyer

  • VP/Dir. Club Forum/DAC Chair, 52 Plus Joker
  • Administrator
  • Forum Sentinel
  • *
  • 19,172
    Posts
  • Reputation: 415
  • Pick a card, any card...no, not THAT card!

  • Facebook:
Man, I miss programming...  Didn't realize how much until I heard those last few posts.
You should totally get back into it!  There's a reason I do it for a living.  Someone once told me "find someone who will pay you for your hobby and you'll never work a day in your life."

How long has it been since you were last into programming?  GW-Basic?  Q-Basic? VB? Or did you manage to slip into my world?  The world of .NET?

I had a pretty solid knowledge of BASIC - as used on old TRaSh-80s and Apple II machines.  In computer history, it's nearly the equivalent of ancient Egypt, or perhaps the Dark Ages of Europe.  I'd have a good deal of catching up to do, I'm sure.


Man do you make me think of my dad! (no offense)

None taken.  I'm glad your dad is a suave, debonair and charming middle-aged man like myself!  And I'm probably old enough to be your dad as well.
Card Illusionist, NYC Area
Playing Card Design & Development Consultant
Deck Tailoring: Custom Alterations for Magicians and Card Mechanics
Services for Hire - http://thedecktailor.com/
Pre-Made Decks for Sale - http://donboyermagic.com/
 

Re: People Who know how to use Python!
« Reply #11 on: March 26, 2012, 09:15:32 AM »
 

AceGambit

  • Discourse Lover
  • *
  • 225
    Posts
  • Reputation: 35
  • mundus vult decepi
I had a pretty solid knowledge of BASIC - as used on old TRaSh-80s and Apple II machines.  In computer history, it's nearly the equivalent of ancient Egypt, or perhaps the Dark Ages of Europe.  I'd have a good deal of catching up to do, I'm sure.

I remember the Apple IIe, with 5 1/4 floppy drives...  Yeah, you've missed an uncomfortable deal of programming, like entire paradigms.  I still say it's worth it, it's literally the most useful skill I have.  But I can understand how making that leap into a world of information can be difficult, I had the luxury of attending four years of college for it.  I can't imagine learning everything I know now without a sort of structured environment to teach it.

You hear that kids!  College is worth it!  Seriously though, anyone who thinks they can learn more on their own than they can in college is just plain wrong.  If your potential to learn is that high, a college environment will only help foster that potential into something much greater.

Now I probably sound like @NathanCanadas dad haha.
They say the greatest trick the devil ever pulled, was convincing the world that he didn't exist.
 

Re: People Who know how to use Python!
« Reply #12 on: March 26, 2012, 10:30:27 AM »
 

Don Boyer

  • VP/Dir. Club Forum/DAC Chair, 52 Plus Joker
  • Administrator
  • Forum Sentinel
  • *
  • 19,172
    Posts
  • Reputation: 415
  • Pick a card, any card...no, not THAT card!

  • Facebook:

And to add to that message: college is a helluva lot easier to deal with at 18-22 than it is in your 30s and 40s...not to mention WAY more expensive.  Do it while you're young, or be prepared for a harder life.  (And the sad part is, a degree is STILL not a guarantee you'll get a job in your chosen field when you graduate...)   >:( :( :-[
Card Illusionist, NYC Area
Playing Card Design & Development Consultant
Deck Tailoring: Custom Alterations for Magicians and Card Mechanics
Services for Hire - http://thedecktailor.com/
Pre-Made Decks for Sale - http://donboyermagic.com/