[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]

Why is this working? The print() function should only work with

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: 19
Thread images: 2

Why is this working? The print() function should only work with python3, but this script is compiling with python2? Both python and python2 should be using the python2 interpreter.
>>
>>56119204
lol.
>>
print("text") is compatible with both 2 and 3.
>>
File: spn.jpg (118KB, 908x908px) Image search: [Google]
spn.jpg
118KB, 908x908px
>>56119277
>>
>>56119277
Is that simply because
("foo")
is the same as
"foo"
?
>>
>>56119277
no it isn't nigger
>>
I hate Python. It's so shitty and non-specific.
>>
>>56119277
but it's not?
>>
>>56119325
> Is that simply because

> ("foo")

> is the same as

> "foo"

> ?
No, print() is a function that is being fed "Foo" as input.
>>
>>56119356
the print() function isn't a part of python 2, that was introduced in python 3...
>>
>>56119337
>>56119355
It is you fucktards

$ python2
Python 2.7.12 (default, Aug 3 2016, 03:10:14)
[GCC 5.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print("faggot")
faggot
>>>
>>
>>56119434
This is the entire point of OP's thread, this shouldn't work. The print function was introduced in python 3.
>>
>>56119475
They patched it so it works the same in both versions
>>
Post on forums or a mailing list. See what kinds of responses you get
>>
Can't you also return("help") even though it's a statement?
>>
>>56119538
I don't buy it. I think my explanation is the most likely >>56119325
>>
This is already covered on SO:
http://stackoverflow.com/questions/12162629/using-print-in-python2-x

>Therefore, to answer the question at hand, print is evaluated as a statement in python 2.x unless you
from __future__ import print_function

>(introduced in python 2.6)
>>
>>56120004
It was also already explained in this thread, but good to link some independent confirmation
>>
>>56119204
Ubuntu.
Thread posts: 19
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.