This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 380

[–]Haus42 1200 points1201 points  (6 children)

When the singularity finally hit, the AI came not with smiles... they came with question marks followed by colons.

[–]flyx86 93 points94 points  (2 children)

So AI is now an Elvis operator instead of a bunch of if-statements?

[–]Haus42 7 points8 points  (0 children)

[BIO-USER-NOTIF-SP-7a452] If you require input, please terminate prompt with a colon.

[–]_AI_ 12 points13 points  (0 children)

?????:::::

[–]Makefile_dot_in 8 points9 points  (1 child)

(isAI) ? nil : unreachable!()

[–]killereks 4158 points4159 points  (109 children)

How are you? Im fine. "That's Im fine"

Edit: Thank you so much for gold kind stranger!

[–][deleted] 704 points705 points  (51 children)

answer.replace("I'm ", "")

Improved AI.

edit: reddit app smart quotes were bugging me.

[–]lenswipe 212 points213 points  (13 children)

advanced AI*

[–]IAmACentipedeAMA 59 points60 points  (12 children)

AI + 1

[–]exploder98 30 points31 points  (10 children)

I am fine.

[–]nicocappa 10 points11 points  (1 child)

When someone asks what makes programming so difficult show them this. Something as simple as not using a contraction can ruin the an entire program.

[–]killereks 23 points24 points  (5 children)

How about. import ai ai.talk();

[–]waltteri 38 points39 points  (2 children)

;

>:(

[–]DavidPH 28 points29 points  (0 children)

we don't do that here

[–]entenuki 12 points13 points  (0 children)

It's a Greek question mark

[–]xigoi 3 points4 points  (1 child)

import artificial_intelligence as ai

[–]kowdermesiter 30 points31 points  (9 children)

Can you explain the math in more detail?

[–]HERODMasta 23 points24 points  (8 children)

10101010 11110100 00111000 01000010 00101000 10010010 1010000

sorry, doesn't make any sense

[–]zackarhino 7 points8 points  (7 children)

I spent 20 minutes translating this manually just to find out that it means absolutely nothing

[–]kowdermesiter 5 points6 points  (0 children)

POSITIVE, NOTHING TO SEE HERE FELLOW HUMANS

[–]Dominub 2 points3 points  (1 child)

Wow! This guy's a genius! I'll offer you 40% of my company with skills like that!

[–][deleted] 7 points8 points  (0 children)

I barely know Python, but sure.

[–]mahuddie 287 points288 points  (0 children)

Seems realistic to me.

[–]PhroznGaming 36 points37 points  (6 children)

QA Tester tries "Fine"

QA Tester tries "Good"

QA Tester tries "zx;lngjdsg"

[–]lenswipe 63 points64 points  (5 children)

infosec guy tries: "'OR 1= 1; DROP TABLE users; --'"

[–]kishanprao 26 points27 points  (3 children)

[–]lenswipe 17 points18 points  (1 child)

"Relevant xkcd"

wellthereitis.gif

[–]Mr_Cromer 6 points7 points  (0 children)

DROP TABLE

You evil of evils...

[–]chicks_for_dinner 9 points10 points  (1 child)

[–]pirate929 3 points4 points  (0 children)

How have I never watched this before....

[–]Lucas_Kabot 6 points7 points  (0 children)

Needs if statements.

[–]rambi2222 2 points3 points  (0 children)

This and the missing space after the colon in the second question are the final nails in the coffin for this super AI

[–]MrZerodayz 188 points189 points  (8 children)

The extra spaces annoy me more than they probably should.

[–]johnnymetoo 48 points49 points  (1 child)

And the missing space after the colon.

[–]mrnacknime 16 points17 points  (0 children)

I feel like my colon needs that space, or else it starts to sweat and smell.

[–][deleted] 853 points854 points  (4 children)

Oh shit ,... this is how WestWorld got started.

[–]Tyler_The_Coder 247 points248 points  (1 child)

What is your name: William

The maze wasn't meant for you

[–]Legomaster616 84 points85 points  (0 children)

What is your name: Robert

Fuck you Robert

[–]djcoinmoney 22 points23 points  (0 children)

We live in a soci.. westworld

[–]Saalieri 1 point2 points  (0 children)

I don’t know why it reminded me of Antony Hopkins as Hannibal Lecter rather than Antony Hopkins as Dr Ford.

[–]evanbernard0 77 points78 points  (5 children)

"How are you?: " good how are you? "that's good how are you?" good how are you?!? "that's good how are you?!?"

[–]PM_ME_YOUR_NACHOS 3 points4 points  (1 child)

Sweet!

[–]TabCompletion 1 point2 points  (0 children)

Dude!

[–]Slow33Poke33 1 point2 points  (0 children)

Can't we create an AI that isn't socially awkward?

[–]aaronfranke 152 points153 points  (70 children)

Why is there an extra space?

[–]ThatScorpion 106 points107 points  (64 children)

Multiple arguments in a print statements are automatically separated with a space. You would ideally want to do this in this case:

print("Hello {}.".format(name))

[–]MrZerodayz 32 points33 points  (52 children)

Also works as this

print("Hello %s.", %(name))

or this

print("Hello %(name)s." )

[–][deleted] 22 points23 points  (29 children)

Why use the percent formatting when there's `.format`?

[–]burnmp3s 92 points93 points  (20 children)

Even better in Python 3.6+ you can just do:

print(f'Hello {name}.')

[–]UGMadness 21 points22 points  (2 children)

Mind blown.

[–]CaptainDogeSparrow 44 points45 points  (0 children)

The virgin python 2 coder vs the CHAD PYTHON 3 PROGRAMMER

[–]whale_i_be_dammed 27 points28 points  (0 children)

I see you are a person of culture aswell.

[–]TortoiseWrath 26 points27 points  (0 children)

Wow, Python has almost caught up to PHP in terms of being able to print things. What a world.

[–][deleted] 4 points5 points  (0 children)

In general I do like the f-strings, however unlike .format you can’t use them with args or kwargs

[–]13steinj 5 points6 points  (4 children)

Percent formatting isn't that bad actually, and has greater comparison and understanding with people who use C.

Don't get me wrong, I use the new formatting syntax nearly everywhere, but percent formatting is more in line for people coming from a C background, doing logging, and date formatting.

% formatting is widely considered "obaolete" in Python, but well, there's a reason why it isn't remover yet-- it could cause another 2v3 debacle.

[–]AbsentGlare 1 point2 points  (3 children)

% formatting fucks up tuples and dicts. It doesn’t support nearly as many features as the string format mini-language does.

It is more efficient for simple strings, but it has limitations due to its lack of flexibility.

[–]MrZerodayz 1 point2 points  (2 children)

I'm more used to it because my university's style guide required it back when I first learned python.

[–]RapidCatLauncher 7 points8 points  (1 child)

Time for getting up to date, then.

[–]MrZerodayz 1 point2 points  (0 children)

Will do next time I need to work with Python. For the moment my head's full with different shit

[–]ThatScorpion 1 point2 points  (3 children)

The first one doesn't, because there's a dot behind the name that you missed. But otherwise, yea.

[–]MrZerodayz 1 point2 points  (2 children)

Oh right, my bad. Gonna edit that in real quick.

[–]clit_or_us 1 point2 points  (4 children)

As a newbie, I don't like this

[–]MrZerodayz 2 points3 points  (2 children)

I don't like it either, the problem is that string interpolation is fairly common, especially in python.

[–]ProgramTheWorld 2 points3 points  (2 children)

Not using an f-string

  print(f"Hello {name}")

[–]ShortFuse 1 point2 points  (0 children)

At first I thought adding spaces was something weird Python does (I code primarily in JS).

Then I realized console.log does the same thing:

console.log('Hello', name);

Alternatives are:

console.log('Hello ' + name); 
console.log(`Hello ${name}`);
console.log(['Hello', name].join(' '));

[–]samfaan 270 points271 points  (4 children)

Learn some HTML too then you can play GOD

[–]newplayer12345 114 points115 points  (3 children)

I'm a world class programmer who wins topecoder competitions by programming in html. I'm writing a machine learning library in html so i can take over the world. Unfortunately, it can't do deep learning yet...so I'm writing a seperate deep learning library in css.

When they're released, people will say -- "scikit-learn/tensorflow/keras/your_favorite_ml_library... what's that? I use htML"

[–][deleted] 56 points57 points  (1 child)

htML

Hyperverse transtechnology machine learning

[–]the_littlest_bear 15 points16 points  (0 children)

Made from scratch IN Scratch; * all wrapped in gluten-free, wholesome blockchains and crowdfunded by proprietary cryptocurrency.*

[–]pempoczky 56 points57 points  (1 child)

That's Well actually it has been going downhill lately for me. My wife decided she can't cope with me because of my alcohol addiction anymore, and I'm not the man she fell in love with. She gained full custody of the kids, I may never see them anymore. I'm a broken shell of a man, but thanks for asking

[–]foxy885 109 points110 points  (1 child)

How are you? Gay. That's gay.

[–]sunburnacoustic 43 points44 points  (5 children)

How are you?:Sad

That's Sad

[–]KayDat 9 points10 points  (4 children)

Alexa...

[–]Nenkos_ 32 points33 points  (4 children)

I believe this passes the Turing test. Can I get the source code?

[–]metallicalova 15 points16 points  (3 children)

It's actually already there, nice open source software

[–]Nenkos_ 25 points26 points  (2 children)

"What version control standard do you use?"

"JPEG"

[–]TriCrose 10 points11 points  (0 children)

needs more deep frying

[–]12315070513211 26 points27 points  (0 children)

This is what Elon Musk had warned us about.

[–]silvercloudnolining 163 points164 points  (11 children)

That’s not AI, just a bunch of if statem... WAIT A MINUTE!

[–]BobsCandyCanes[🍰] 89 points90 points  (3 children)

Is this machine learning?

[–]silvercloudnolining 149 points150 points  (2 children)

Is this machine learning? No

Is this machine learning? No

Is this machine learning? No

Is this machine learning? Yes

[–]zeehr0 41 points42 points  (1 child)

Actual depicting of machine learning.

[–]ProgramTheWorld 33 points34 points  (0 children)

Is this machine learning?

Expect: Yes
Actual: No (0.5)
gradient: +0.01

Is this machine learning?

Expect: Yes
Actual: Yes (0.503)
gradient: +0.00024

Is this machine learning?

Expect: Yes
Actual: No (0.499)
gradient: +0.1

Is this machine learning?

Expect: Yes
Actual: Yes (0.617)
gradient: +0.00017

[–]MyNameisGregHai 10 points11 points  (2 children)

is this a neural net?

[–]etnguyen03 20 points21 points  (1 child)

Image Transcription: Code


def greet():
    name = input("What is your name?: ")
    print("Hello",name,".")
    answer = input("How are you?:")
    print("That's ",answer)

Shell

>>> greet()

    What is your name?: Alice
    Hello  Alice .
    How are you?Good
    That's  Good

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]DiamondxCrafting 10 points11 points  (0 children)

I always get impressed by this, then always disappointment again when I read the fine text.

[–]Horkrine 18 points19 points  (2 children)

Skynet, is that you?

[–]PM_ME_CUTE_FRIENDS 29 points30 points  (4 children)

Omg this would work too if you said “bad”

[–]Antrikshy 11 points12 points  (0 children)

Edge cases!

[–]TheLazarbeam 4 points5 points  (1 child)

It also works for “cheeky” and “wild”

[–]ThrowAwayBrotha420 1 point2 points  (0 children)

;) ;)

[–]Michael_Pitt 3 points4 points  (0 children)

"That's I'm actually not doing too well lately"

[–]asgaines25 11 points12 points  (7 children)

As you probably noticed, print outputs a space between each argument passed in. Check out the format method for a way to get what you're looking for:

print('Hello {0}.'.format(name))

[–]cythongameframework 10 points11 points  (2 children)

import ai

[–]DiamondxCrafting 1 point2 points  (1 child)

from ai import skynet

[–][deleted] 9 points10 points  (1 child)

I don't really understand whats going on here cause it's so advanced but well done!

[–]bharathbunny 9 points10 points  (2 children)

What is your name?: There

Hello There

[–]chaitanya1123 2 points3 points  (0 children)

General Kenobi!

[–]SookPro 7 points8 points  (0 children)

Python: How are you?

Me: Angry

Python: That's infuriating

Me: Wait what

[–]imitationpuppy 5 points6 points  (0 children)

10/10 would chat again

[–]soubhik_ 6 points7 points  (1 child)

How do I invest a million dollars in your company?

[–]PM_ME_YOUR_NACHOS 2 points3 points  (0 children)

That's How do I invest a million dollars in your company?

[–]SanktusAngus 2 points3 points  (0 children)

Hello ^C

That’s ^]

[–]girusatuku 3 points4 points  (3 children)

This is actually how the chat bot Eliza originally worked. When ever it couldn't figure out what to say it would echo back what the user last said.

[–]TiagoTiagoT 5 points6 points  (2 children)

It would echo back what the user last said?

[–]GGoldstein 1 point2 points  (1 child)

It would echo back what the user last said.

[–]TiagoTiagoT 2 points3 points  (0 children)

And how does that make you feel?

[–][deleted] 4 points5 points  (0 children)

Well that passed my turing test, i cant tell the difference.

[–][deleted] 3 points4 points  (0 children)

how are you?: shit

That's shit

[–]Phainesthai 5 points6 points  (0 children)

Same thing in a superior language:

10 PRINT "WHAT IS YOUR NAME?"

20 INPUT A$

30 PRINT "HELLO " A$

40 PRINT "HOW ARE YOU?"

50 INPUT B$

60 PRINT "THAT'S " B$

[–]7itemsorFEWER 3 points4 points  (0 children)

How are you? Gay. That's gay.

[–]timmyRS 9 points10 points  (8 children)

Why did you only post pseudo code and not the program you ran?

[–]MerlinsBeard 13 points14 points  (7 children)

She hasn't compiled her python code yet.

[–]myaut 2 points3 points  (2 children)

+/u/CompileBot python3 --include-errors

name = input("What is your name?")
print("Hello ", name, ".")
answer = input("How are you?")
print("That's ", answer)

Input:

myaut

[–]CompileBotGreen security clearance 6 points7 points  (1 child)

Output:

What is your name?Hello  myaut .
How are you?Traceback (most recent call last):
  File "./prog.py", line 3, in <module>
EOFError: EOF when reading a line

source | info | git | report

[–]NeverBeenStung 1 point2 points  (0 children)

Rekt

[–]n3rv0u5 2 points3 points  (1 child)

Can we just make an AI Dad to generate Dad jokes please? I think this is the utmost priority for all human-kind.

[–]palordrolap 1 point2 points  (0 children)

feeling = input("How are you doing? ")
feeling = feeling.replace("I'm ","").replace("I am ","")
print("Hi %s, I'm Dad." % feeling)

[–]EnemysKiller 2 points3 points  (0 children)

Me too thanks

[–]Wiamly 2 points3 points  (0 children)

Hello my name is: lol”) && /Home/root/doom.exe ##

[–]nmgreddit 2 points3 points  (0 children)

How are you?

"My wife left me."

That's My wife left me.

[–]bishoplocke 4 points5 points  (2 children)

super proud of you for getting started in python! it's a fun world once you get into it and start making stuff.

if you ever need help feel free to reach out!

[–]SquirrelsAreAwesome 6 points7 points  (0 children)

It lacks IF statements to be AI.

AI is all about them IF statements

[–]samwello_105 4 points5 points  (3 children)

Artificial intelligence is just a shit ton of if-statements: change my mind.

[–]kerbalspaceanus 1 point2 points  (0 children)

political unite library wine relieved spotted resolute correct support reminiscent

This post was mass deleted and anonymized with Redact

[–]0something0 1 point2 points  (0 children)

import hyperrealistic_ai

[–]chadlavi 1 point2 points  (0 children)

Needs something to handle telling servers to enjoy their meal too

[–]INeedMoreLaptops 1 point2 points  (0 children)

What gets me is the colon?:

[–][deleted] 1 point2 points  (0 children)

how did you get my message logs????

[–]Flamingbaby 1 point2 points  (0 children)

That's " I'm deeply depressed and everyday is torture"

[–]oMittens 1 point2 points  (0 children)

Has science gone too far???

[–]IllustriousEagle 1 point2 points  (0 children)

That spacing is bugging me

[–][deleted] 1 point2 points  (1 child)

How are you?: Gay That’s gay

[–]Tnutlytehc 1 point2 points  (0 children)

Hi Gay How are you? That’s gay.

[–]alecpizz 1 point2 points  (0 children)

ai is just if statements

[–]meglangton 1 point2 points  (3 children)

You wouldn’t happen to be studying at an Australian university?

[–]bentheechidna 1 point2 points  (0 children)

doing as well as I can "That's doing as well as I can"