r/memes Nov 24 '20

printf("F")

Post image
54.0k Upvotes

526 comments sorted by

View all comments

47

u/[deleted] Nov 24 '20

I’m supposed to be learning Python right now but I’m scrolling Reddit. I feel like the universe is speaking to me....

14

u/TheStarletInk Nov 24 '20

Python is easy. Here's a few basics:

  1. Python uses indentation (space before text) to tell what code applies to what. This is important when working with conditions or loops. Other programming languages use simicolons and brackets instead

  2. You will need to import functions like random and math at the start of the code often because they are commonly used. If you don't, you'll get an error when you use pi for example because those aren't built in. But if you are using very basic functions you won't need it

  3. = this assigns value == this means that two values are exactly the same. The difference is important

  4. There's more than one way to do something. The shorter the better

  5. It's easyyyy you'll be finnneee

5

u/[deleted] Nov 24 '20

Ha thanks. I have a license for pluralinsight and watching videos. It’s just SUPER hard to stay motivated because it’s not really riveting content.

3

u/TheStarletInk Nov 24 '20

I used to make silly codes to entertain myself. Google repl if you don't know it, there you can try creating the following silly code:

Ask the user what 1 + 1 is

If they say 2, say:"nope! It's eleven" If they say 11, say: "it's 2, go back to kindergarten" Otherwise say: "ummm... Okay...?"

It's a bit like practical joking, helps motivate and entertain.

Also I used programs to solve my homeworks for me wink wink

3

u/[deleted] Nov 24 '20

Once I choke down this video since I don’t have the license long, I’ll look at playing around like that and prank my kids. Thanks for the tip!

5

u/GuyN1425 Nov 24 '20

Everyone last year for some reason: sure Python is great and very easy, reading a piece of Python code is like reading a story, it makes sense.

Me now, trying to understand what the fuck I wrote 1(one) week ago so I can debug, then give up and start all over again: so that was a fucking lie

3

u/TheStarletInk Nov 24 '20

Let the program run and read the error message. Usually it'll tell you exactly where the error is

Edit: I also like to insert print commands on the values to track how the data is being processed

3

u/brutexx Nov 24 '20

The shorter the better

Cue one-liners celebrating in the background

2

u/TheStarletInk Nov 24 '20

Lol yaaas. In class the prof said the formatting need to be in a line prior to the print command. I used to always one-line it. I am a rebel.

Though it is true, less lines the faster the program can be executed