33 Answered Questions for the topic String
03/26/19
How can I print literal curly-brace characters in python string and also use .format on it?
x = " \\{ Hello \\} {0} " print x.format(42) gives me : `Key Error: Hello\\\\`I want to print the output: `{Hello} 42`
String Python
03/26/19
Reverse a string in Python?
There is no built in `reverse` function for Python's `str` object. What is the best way of implementing this method?If supplying a very concise answer, please elaborate on its efficiency. For...
more
Does Python have a string 'contains' substring method?
I'm looking for a `string.contains` or `string.indexof` method in Python.I want to do: if not somestring.contains("blah"): continue
03/19/19
Pythonic way to create a long multi-line string?
I have a very long query. I would like to split it in several lines in Python. A way to do it in JavaScript would be using several sentences and joining them with a `+` operator (I know, maybe it's...
more
03/18/19
Determine if two strings are similar in Javascript?
Let's say I have two strings, is there any way to check if they are at least 90% similar?
var string1 = "theBoardmeetstoday,tomorrow51";
var string2 = "Board meets today, tomorrow";
Thanks,
Tegan
more
String
02/25/18
A 22-in piece of string is cut into two pieces. One piece is used to form a circle while the other is used to form a square.
How should the string be cut so that the sum of the areas is a minimum?
12/04/15
How do I display the a string a random amount of time and print it out?
I am writing the Nim game program and my teacher wants me to be able to display "Pile 1: @@@@" and other piles as well. The thing is that, the "@" symbol needs to be produced a random amount of...
more
How many beads on this string?
There are 4mm beads on a 16 inch string. how many beads are on the string?
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.