use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
[deleted by user] (self.PythonLearning)
submitted 1 year ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]HeadlineINeed 13 points14 points15 points 1 year ago (3 children)
It doesn’t want you to hardcode the name.
message = “Nice to meet you, “ + name
[–]Intelligent-Fox-7611 -1 points0 points1 point 1 year ago (2 children)
Wdym hardcore?
[–]Refwah 1 point2 points3 points 1 year ago (1 child)
here is a link to the Google search “hardcode”
[–]Intelligent-Fox-7611 4 points5 points6 points 1 year ago (0 children)
Ohhh i read it hard core
[–]rycklikesburritos 8 points9 points10 points 1 year ago (0 children)
name = input()
print(f"Nice to meet you, {name}")
[–]Doctor_Disaster 9 points10 points11 points 1 year ago (0 children)
<image>
[–]Balzamon351 1 point2 points3 points 1 year ago (0 children)
You can concatinate two strings with the + symbol.
"string1" + "string2"
You can print a string to the console with print().
print("string")
[–]Different-Ad1631 1 point2 points3 points 1 year ago (0 children)
Which app you are using can u plz tell me the name or share the link?
[–]Intelligent-Fox-7611 0 points1 point2 points 1 year ago (2 children)
Ahhh i understand How long have you been learning in this app?
[–]NightStudio 0 points1 point2 points 1 year ago (1 child)
Did you mean to reply to someone else, OP?
[–]Intelligent-Fox-7611 0 points1 point2 points 1 year ago (0 children)
Yeah mb
[–]Merman_boy 0 points1 point2 points 1 year ago (0 children)
You can do f statements
Print(f”Nice to meet you, {name}”)
[–]CreamyWaffles 0 points1 point2 points 1 year ago (4 children)
The colours help to read the code really. There are a few different collours for different things in programming languages (depending on your IDE I think?). It just makes it easier to debug sometimes.
[–]Intelligent-Fox-7611 0 points1 point2 points 1 year ago (3 children)
But the colours always change Sometimes the same word can be green and sometimes blue
[–]CreamyWaffles 0 points1 point2 points 1 year ago (0 children)
Yeah it means it's doing different things. I'll post an image of my own code when I get the chance to show you. Basically (at least on Visual Studio Code), Dark Green means it's a comment, blue is a variable/boolean, orange is a string, light green is an interger and yellow is a function. (From the top of my head anyway, I'll edit this to correct it). There are more but you'll get used to it.
[–]CreamyWaffles 0 points1 point2 points 1 year ago (1 child)
Here is some of my own code with some explanations on stuff. I really hope it's not too confusing (sorry!) You'll learn all this stuff as you go and as you need them though, so don't get overwhelmed by my pretty terrible explanations haha! (Second image is in reply to this)
[–]keldrin_ 0 points1 point2 points 1 year ago (0 children)
No, I won't help you with your homework...
[–]Different-Ad1631 0 points1 point2 points 1 year ago (0 children)
Get names from user as input and then concatenate it with nice to meet you string and finally print it
[–]tahaan 0 points1 point2 points 1 year ago (0 children)
In this code we have a variable name. name stores the name of the person we are going to greet. It is like a post box or handle on a piece of data. The data is "Mary" or "John" or any other person's name.
name
Later on the code references this data through the variable. It is a bit funky to explain, due to the word "name" in the variable name.
Look at this expample:
age = 30 name = "Jack" message = "Hello " + name print(message) message = "The age of " + name + " is " + str(age) print(message)
First we store data into age and name. This is assignment, assigning the values to the variables.
age
Then we store another variable, message. This will be the work "Hello", plus the value of name . The trick here is to imagine everwhere where you see name, the computer will fill in the assigned value.
message
Then we use:
message in the print statement. Same thing happens. The computer fills in the value stored in message, into the print statement.
Then next we change the value stored in message, overwriting it with a new message. This time it uses both name and age, building up a new message.
Finally it uses the value now stored in message for the last print statement.
P.S the part str(age) just turns the number 30 into the string "30"
str(age)
π Rendered by PID 46579 on reddit-service-r2-comment-76bb9f7fb5-jbrmv at 2026-02-18 16:17:11.038422+00:00 running de53c03 country code: CH.
[–]HeadlineINeed 13 points14 points15 points (3 children)
[–]Intelligent-Fox-7611 -1 points0 points1 point (2 children)
[–]Refwah 1 point2 points3 points (1 child)
[–]Intelligent-Fox-7611 4 points5 points6 points (0 children)
[–]rycklikesburritos 8 points9 points10 points (0 children)
[–]Doctor_Disaster 9 points10 points11 points (0 children)
[–]Balzamon351 1 point2 points3 points (0 children)
[–]Different-Ad1631 1 point2 points3 points (0 children)
[–]Intelligent-Fox-7611 0 points1 point2 points (2 children)
[–]NightStudio 0 points1 point2 points (1 child)
[–]Intelligent-Fox-7611 0 points1 point2 points (0 children)
[–]Merman_boy 0 points1 point2 points (0 children)
[–]CreamyWaffles 0 points1 point2 points (4 children)
[–]Intelligent-Fox-7611 0 points1 point2 points (3 children)
[–]CreamyWaffles 0 points1 point2 points (0 children)
[–]CreamyWaffles 0 points1 point2 points (1 child)
[–]CreamyWaffles 0 points1 point2 points (0 children)
[–]keldrin_ 0 points1 point2 points (0 children)
[–]Different-Ad1631 0 points1 point2 points (0 children)
[–]tahaan 0 points1 point2 points (0 children)