Skip to content
murmot

Results for “python string array example question code java site:discuss.python.org download”

  • discuss.python.org

    Discussions on Python.org

    Discussions related to the Python Programming Language, Python Community, and Python Software Foundation operations.

  • discuss.python.org

    Dealing with strings that are multiple words - Python Help ...

    Mar 7, 2024 · It’s here for whoever in the world wish to know how to work with multiple words in a string. Note that this only works if the Words are separated by a blank space (space on keyboard), because the string.split (), in parenthesis, you should pass the argument you want to split the words base upon. Default is blank space.

  • discuss.python.org

    Ports in an array - Python Help - Discussions on Python.org

    To answer your question: input always returns a string.The input() function returns a string, because it is something someone has typed. In Python, strings are iterable things, and iteration gets you each character (as a 1-character string). So if you have code

  • discuss.python.org

    Help needed with split and sort - Python Help - Discussions ...

    Jul 2, 2023 · "Hello this Is an Example With cased letters" I guess it is possible that the question was worded incorrectly, and that casing was left out of the description. But the casing makes all the difference to the sorting of the words, because in Python strings are sorted by comparing the sequence of ordinal values (code points with respect to the encoding scheme) of the characters in the strings, e ...

  • discuss.python.org

    How to get null terminated strings from a buffer? - Python Help...

    Do you have a small example that shows what you can so far? Once you have ctypes returning the array of 260 word (520 bytes) buffer to python you can decode it with buf.decode(‘utf-16’) and then look for ‘\0’ in the unicode string. I would be tempted to use.

  • discuss.python.org

    Quick question on .join () - Python Help - Discussions on ...

    Mar 31, 2022 · The '' makes an empty string. .join () calls a method on the string. A method is somewhat like a function, but attached to a specific object. The join () method of string objects concatenates strings with the string whose method is being called as the separator. That should give you most search terms to learn more.

  • discuss.python.org

    How to use f string format without changing content of string?

    Python documentation. string — Common string operations. Source code: Lib/string.py String constants: The constants defined in this module are: Custom String Formatting: The built-in string class provides the ability to do complex variable substitutions ...

  • discuss.python.org

    String concatenation with a for loop - Python Help ...

    Nov 26, 2024 · CPython actually does specific optimizations for string concatenation that means it tries to reuse the original object and avoid copying. I suspect this doesn’t always work, but even if it only works sometimes it can be a huge difference. This can only work if the reference count of the object is exactly 1. I suspect that with the changed behavior of global variable accesses compared ...

  • discuss.python.org

    Splitting a string of numbers into smaller strings - Python ...

    Jul 14, 2024 · The “smaller strings”, do they require 7 comma separated values? It can be difficult to provide guidance without the full picture A good place to start is having a look at str methods. One of the best ways to “slice and dice” a string (without slicing) is str.split. Note also, that a strings have concatenation method called join.

  • discuss.python.org

    How to write a function that returns a simple string value

    Oct 11, 2022 · Help please. I have to write a simple function that returns a string. The string (in this example) is a city and a country e.g. London, England I have done some other exercises where I return a formatted name e.g. Bob Johnson, but I cannot get this one right Here is my codes so far: def city_country(city_name, country_name): """Return a string value of information about a city and country ...