What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-14 05:39:10
reverse a number in python
# Python string/number reverser example_number = 12143 example_string = "Hello there" def reverse(thing): thing = str(thing) # convert it to a string, just in case it was a number list_of_chars = [char for char in thing] reversed_l... Add solution -
Python 2021-10-31 01:35:10
capitalize python
# Python string capitalization string = "this isn't a #Standard Sntence." string.capitalize() # "This isn't a #standard sentence." string.upper() # "THIS ISN'T A #STANDARD SENTENCE." string.lower() # "this isn't a #stand... Add solution -
Python 2021-10-25 14:47:09
python submit work to redis
# step 1: import the redis-py client package import redis # step 2: define our connection information for Redis # Replaces with your configuration information redis_host = "localhost" redis_port = 6379 redis_password = "" def hello... Add solution -
Python 2021-10-21 07:07:02
TypeError: dict is not a sequence
# If you're using SQLAlchemy: # Use "%%" instead of "%" in your queries, because # a single "%" is used in Python string formatting. # Alternatively escape the SQL properly with sqlalchemy.text(...): engine.execute(sqlalchem... Add solution -
Python 2021-10-10 04:48:10
capitalize string python
# Python string capitalization string = "this isn't a #Standard Sntence." string.capitalize() # "This isn't a #standard sentence." string.upper() # "THIS ISN'T A #STANDARD SENTENCE." string.lower() # "this isn't a #stand... Add solution -
Javascript 2021-10-04 11:27:05
python run javascript
import js2py js = """ function escramble_758(){ var a,b,c a='+1 ' b='84-' a+='425-' b+='7450' c='9' document.write(a+c+b) } escramble_758() """.replace("document.write", "return ") result = js2py.eval_js... Add solution