[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Hey guys, Python newb here. Literally my first day learning any

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 23
Thread images: 2

File: helpmeplzg.png (152KB, 3718x1006px) Image search: [Google]
helpmeplzg.png
152KB, 3718x1006px
Hey guys, Python newb here. Literally my first day learning any computer language, from what I heard Python is a fine first language to learn. Anyways, I'm doing the exercises in Code Academy while also trying to follow along and doing them as well in my IDE (IDLE). For whatever the fucking reason, what I type in CA doesn't fucking work in IDLE. I keep getting this bullshit fucking error invalid syntax.

If someone could help me out that be great, I'd imagine it's a very noob and simple error to fix. Thanks guys.
>>
Try putting parentheses around your print statement, for example:
print(test)
>>
>>55906095
This guy is correct.

Code Academy teaches you an older version of python. In the latest version you must put parenthesis around your print statements.
>>
>>55906023
You're missing a parenthesis surrounding the string in quotes. It says so right in the error message. Also, CodeAcademy teaches version 2.7 while you're using 3.5. Download version 2.7 if you want to follow along with the tuts.
>>
>>55906095
>>55906139
It worked! thanks guys!
>>
2.7>3.5 desu
>>
>>55906212
>>55906150
I guess I'll download 2.7 then since I am following along with CA.

Also, I've been wanting to make like some app that's like a catalog. This is possible with Python right? How long do I need to learn Python to be able to make this simple catalog app?
>>
>>55906288
A text-based "catalog" or something with visuals? There are GUI libraries for Python. Also I recommend learning Python 3 and up. 2 is being phased out but you still have people clinging to it for dear life like >>55906212
>>
>>55906288
what do you mean by catalog?

>>55907129
how is 3 phasing out 2? The differences seem very menial to me
>>
>>55907155
Python 2 is barely receiving updates anymore, if any. Python 3 was a redesign fixing a lot of the flaws present in Python 2, syntax standardization like print not being a keyword and just a function, etc.
>>
>>55907203
Yep, i have to give you that, however all i've seen different is that raw_input is now input and the print thingy

I have both installed, but honestly for some reason i prefer my prints to not have parenthesis, however i don't know shit so my opinnion is worthless, but how useful are the updates? Should i just change from 2 to 3 or can i keep postponing it?
>>
>>55907155
Like a database. Think of something like a fucking pokedex, I don't know. Something like that.
>>
>>55907246
Off the top of my head I can't think of any other language where print is a keyword and not a function in a standard library. 2 is being kept on life support for those systems built on it that don't/can't migrate to 3.

Think of it this way, would you continue to use Windows XP in this year or Windows 7 5 years from now, etc?
>>
>>55907246

just stay with 3.5

When 2.7 finally dies it's a pain in the ass to port things to 3
>>
>>55906212
>t. UnicodeDecodeError
>>
>>55908242
doesn't this port it?

lines = open("myfile.py", "r").read().split("\n")

first_pass = []
for line in lines:
x = line.replace("raw_input", "input")
first_pass.append(x)


my_lines = []
for line in first_pass:
nu_line = line
print_pos = line.find("print")
if print_pos != -1:
cut_line = line[print_pos + 5:]
new_line = "print (" + cut_line + ")"
nu_line = new_line

my_lines.append(nu_line)


shit = '\n'.join(my_lines)


x = open("myfile_ported.py", "w").write(shit)



granted if you used formatting(or whatever % is called) is a bit harder, but yet very doable

>>55907661
its different, you want your OS to be up to date cause of security stuff, you don't want your dick pics to be hacked, i honestly don't know if there's any valid (meaning practical) reason to remember to use brackets in my prints
>>
>>55907568
yes, learn what classes, __str__(), open(), and json() are
>>
>>55906023
After you get handy with python from code academy, you shall work around with automate the boring stuff with python.
> automatetheboringstuff.com
>>
use notepad++, create .py files and run the files in windows powershell by typing:

python 'filename'.py
>>
In Python 3 print is now a function. By the way IDE's make people stupid. Stop using an IDE and then when you're finished with Codecademy do LPTHW.
>>
File: blink.png (3KB, 420x66px) Image search: [Google]
blink.png
3KB, 420x66px
>>
Try reading the error messages faggot.

And Python3 is a meme, use 2.7.
>>
>>55906095
>>55906139
>>55911801


Python is such a clusterfuck..

>inconsistent sytax without backwards compatibility
>unnecessary stuff everywhere


Learn Ruby already, it's so much more intuitive in every singe way:

a = 4
print a
print(a)
print "beaver".upcase


>hurr, muh code artisans
Thread posts: 23
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.