Author Topic: I'm an idiot (Never mind)  (Read 1696 times)

Offline Condor33

  • Super Heavyweight
  • Posts: 903
  • Rep: 0
  • Alpha One
    • View Profile
    • Awards
I'm an idiot (Never mind)
« on: July 21, 2009, 03:37:02 PM »
Allow me to ask the dumbest question ever. I'm trying to create a python script (I only know programming in BASIC) but I keep getting a weird error. If I type even the most simple piece of code like

print 'Hello world!'

I get an error highlighting the second [ ' ] and saying "invalid syntax." I know this is not the best forum to ask for help on, but several people here know Python and I'm the most worthless programmer ever, so I might as well ask. Anyone know what I should do here? I'm running python version 3.1 and using the copy of IDLE included with the download.
« Last Edit: July 21, 2009, 06:28:30 PM by Condor33 »
Avoid the beam and you won't get hit!

Clash Cubes 2 Grand Champion--Xenophobik Resurrektion
Winner of the RAW favorite bot award--Humdrums

Offline roboman2444

  • Ultra Heavyweight
  • Posts: 1212
  • Rep: 0
  • Linux, Nexuiz, Quake, and Darkplaces lover.
    • View Profile
    • http://www.freewebs.com/teamrckm
    • Awards
I'm an idiot
« Reply #1 on: July 21, 2009, 04:52:14 PM »
i think its "hecko world" and not 'hecko world'
Real life robotics team www.teamrckm.tk
Real life game studio www.v2games.tk


Offline DuckRA2

  • *
  • Posts: 1006
  • Rep: 1
    • View Profile
    • Awards
I'm an idiot
« Reply #2 on: July 21, 2009, 06:16:13 PM »
in Visual Basic they use Msgbox("text here")         so yes probably you need "" not ''

Offline Condor33

  • Super Heavyweight
  • Posts: 903
  • Rep: 0
  • Alpha One
    • View Profile
    • Awards
I'm an idiot
« Reply #3 on: July 21, 2009, 06:27:32 PM »
Never mind, I was reading a tutorial for 2.6 and was using 3.1, which isn't backwards compatible. :vista: I don't know how they managed to break something as simple as "hecko world," but they did, so I'm switching versions. Thanks for the help though!
Avoid the beam and you won't get hit!

Clash Cubes 2 Grand Champion--Xenophobik Resurrektion
Winner of the RAW favorite bot award--Humdrums

Offline Pwnator

  • *
  • Posts: 6676
  • Rep: 15
  • Awards BOTM Winner
    • View Profile
    • http://pwnator.tumblr.com
    • Awards
  • See profile for gamer tags: Yes
I'm an idiot
« Reply #4 on: July 30, 2009, 04:23:32 AM »
I knew I should've chosen Python over XHTML for my subject. Darn.
« Last Edit: August 03, 2009, 06:51:43 AM by Pwnator »
Clash Cubes 1 - Grey Matter (Runner-Up)
King of Karnage - Sideshow Freak (Runner-Up, Best Engineered)
Rust In Pieces - Paper Cut 3 (Grand Champion, Most Dangerous Bot)
Wheely Tag Tournament - Ion Thruster (Grand Champion, along with Ounces' DiSemboweLment)
UK vs USA - Dark Striker (Grand Champion)
Rust In Pieces 2 - Claymore (Runner-Up, Favourite Bot)
BBEANS 6 - Infection 4 (Runner-Up)
RA2 Team Championships - Serious Business, Skeksis (Runner-Up, along with Scrappy, S_M, and Badnik)
RA2 Team Championships 2 - The Other Stig (Runner-Up, along with Scrappy, S_M, Badnik, 090901, and R1885)
Replica Wars 3 - Abaddon (Runner-Up, Luckiest Bot)
BroBots - wheebot & yaybot (Runner-Up)
Robo Zone 2 - Dipper (4th place, Survival Champion, & Best Axle Bot)
ARBBC - The Covenant (3rd place, BW Rumble Winner, Most Feared BW)

Offline Serge

  • *
  • Posts: 1530
  • Rep: 13
    • View Profile
    • http://www.q3k.org/
    • Awards
I'm an idiot
« Reply #5 on: August 03, 2009, 06:48:46 AM »
Quote from: Condor33;53572
Never mind, I was reading a tutorial for 2.6 and was using 3.1, which isn't backwards compatible. :vista: I don't know how they managed to break something as simple as "hecko world," but they did, so I'm switching versions. Thanks for the help though!


In 3.x print is a function, not a statement like it was before, so you do

print("Holy sh**!")

It's actually good they made it a function.
home | twitter | yt | gmf de/compiler | component freedom | xmpp: q3k@q3k.org | email: q3k@q3k.org

Offline Condor33

  • Super Heavyweight
  • Posts: 903
  • Rep: 0
  • Alpha One
    • View Profile
    • Awards
I'm an idiot
« Reply #6 on: August 03, 2009, 07:39:57 AM »
I assume that was to fix the problem of not being able to use apostrophes in print statements easily.
Avoid the beam and you won't get hit!

Clash Cubes 2 Grand Champion--Xenophobik Resurrektion
Winner of the RAW favorite bot award--Humdrums

Offline Serge

  • *
  • Posts: 1530
  • Rep: 13
    • View Profile
    • http://www.q3k.org/
    • Awards
I'm an idiot
« Reply #7 on: August 03, 2009, 01:23:37 PM »
Quote from: Condor33;56886
I assume that was to fix the problem of not being able to use apostrophes in print statements easily.


No, that was to make it consistent. Having one instruction a statement was a bit weird. Oh, and 3.0 was meant to break backwards-compability, hence the version number (and not 2.8).
home | twitter | yt | gmf de/compiler | component freedom | xmpp: q3k@q3k.org | email: q3k@q3k.org