Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
Why has os.linesep() been used here in my code?
def GetInstruction():
print(os.linesep)#<--------???
Instruction = input("> ").lower()
return Instruction
I don't know why you're using it, but from the docs:
The string used to separate (or, rather, terminate) lines on the current platform. This may be a single character, such as '\n' for POSIX, or multiple characters, for example, '\r\n' for Windows.
Basically represents the current line separator default for your current environment or platform.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
as mentioned in the title..
What "rc" stands for in the latest Python 3.91rc1 version name?
Thanks
Answer
Release Candidate
Notes
"In Software Versioning: A different approach is to use the major and minor numbers, along with an alphanumeric string denoting the release type, e.g. "alpha" (a), "beta" (b), or "release candidate" (rc)."
Source
https://en.wikipedia.org/wiki/Software_versioning#Pre-release_versions
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
“C”, “c”, “coffee” or ANY combination of upper and lower case letters
that correctly spells “coffee”, i.e., “Coffee”, “COFFEE”, “coffEE” are acceptable, if doesn't meet requirement program ends, or else the program continues.
You can use str.lower() to make the input lowercase for a case-insensitive match:
import sys
expected = 'coffee'
if input('What do you want? ').lower() not in (expected[0], expected):
sys.exit()
print('Right. Continuing...')
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
Which name is given a function that is separated by undescore.
function_name.
And to a function like FunctionName? and what would be the right one for python and ANSI C.??
Function names like func_one are written in snake case, while functions written like FunctionOne are written in Pascal case, which is a subset of Camel case where the first letter is also uppercase.
Thanks to #abelenky for pointing out the initial error.
function_name is called a Snake Case. It is the recommended casing for Python.
See this answer for more enlightenment.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I need to know the meaning of <> in Python. In Visual Basic, it means that if we have a<>0 then a is not equal to zero.
It's the same in Python 2, it means "not equal". See documentation here.
!= can also be written <>, but this is an obsolete usage kept for backwards compatibility only. New code should always use !=.
Python 3 does not have the <> operator.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
What does : mean in python? I'm learning how to program in python and the tutorial i'm using
doesn't explain what : does. I can't find what : does on the internet either. Please answer :D
In object indices (e.g. some_list[4:-1]), this is called slice notation. You use it to access parts of a list/object instead of single items. See also this question for more information.
On other statements, it is required by the syntax to introduce a new code block, like on try: or if something: