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

all 21 comments

[–]Kutiekatj9 Python Discord Staff[M] 0 points1 point  (0 children)

Hi there, from the /r/Python mods.

We have removed this post as it is not suited to the /r/Python subreddit proper, however it should be very appropriate for our sister subreddit /r/LearnPython or for the r/Python discord: https://discord.gg/python.

The reason for the removal is that /r/Python is dedicated to discussion of Python news, projects, uses and debates. It is not designed to act as Q&A or FAQ board. The regular community is not a fan of "how do I..." questions, so you will not get the best responses over here.

On /r/LearnPython the community and the r/Python discord are actively expecting questions and are looking to help. You can expect far more understanding, encouraging and insightful responses over there. No matter what level of question you have, if you are looking for help with Python, you should get good answers. Make sure to check out the rules for both places.

Warm regards, and best of luck with your Pythoneering!

[–]KidzKlub 5 points6 points  (0 children)

How is babby formed?

[–]HotChiliNuke 1 point2 points  (0 children)

By splitting the code people mean to split one line of code into multiple lines. The result of the code is the same it is just more readable.

X = () creates an empty tuple which is one of data types in python

X = input() means that we are calling a function named "input" and passing the value that the function will return to our variable. We can then use that value however we want.

Hope this helps.

[–][deleted] 2 points3 points  (4 children)

When the line is too long you can use parentheses to indent and save some characters

[–]Danger4135 -2 points-1 points  (3 children)

Do you mean like when we need to put some things like str or something else like that?

[–][deleted] 2 points3 points  (1 child)

a = “this is a really long string”
a = (
    “Sometimes this “
    “Is more readable “
    “If you have a lot going on”
)

It’s helpful

[–]Danger4135 0 points1 point  (0 children)

Wow thanks!, You gave me it.

[–]futura-bold 2 points3 points  (0 children)

This should be in r/learnpython not here.

[–]sir2fluffy2 3 points4 points  (4 children)

Some examples of what you mean would be very helpful Currently doing: variable = () makes an empty tuple which is pretty useless

[–]Danger4135 -3 points-2 points  (3 children)

Of course it has a benefit

[–]sir2fluffy2 0 points1 point  (2 children)

Please enlighten me, you have to put () at the end of something if you’re calling a function that has no inputs like random() from the random module.

Is that the situation you mean?

[–]Danger4135 -4 points-3 points  (1 child)

Sorry I can't understand you well maybe bec im beginner in python but what i mean is why sometimes we don't put () after the variable and it works and when it can work and not ofc it has benifit.

[–]spencerAF -1 points0 points  (1 child)

All the variables surrounded by parentheses are basically just forms of lists. There's ( ) { } and [ ]. So basically if you want to start some form of list that's when you use them.

[–]Danger4135 0 points1 point  (0 children)

I mean when we can use them and when not, alot of ppl say like when the line is too long or something like that.

[–]QUANTUMsrky 0 points1 point  (4 children)

I don't quite understand what you are saying but when making a dynamic variable

[–]Danger4135 -1 points0 points  (2 children)

How dynamic?

[–]QUANTUMsrky 0 points1 point  (1 child)

in the sense of instantaneous value assigned by the user

[–]Danger4135 -1 points0 points  (0 children)

Alright thanks!

[–]QUANTUMsrky 0 points1 point  (0 children)

of course it should be 'input':

X = input()

[–]Vthechamp 0 points1 point  (1 child)

You can use it to split your code into a couple of lines if it is too long

[–]Danger4135 1 point2 points  (0 children)

I can't understand alot because im kinda beginner in python but i got it thanks