Version | 01 |
Release Date | 01 Jan 2021 |
Type | SAP Documents |
Status | Released |
Replace multiple instance of a sub string using Re module
import re
txt = "The rain in Spain"
x = re.search("^The.*Spain$", txt)
Use """ (3 quotes) for string extending to multiple lines.
LongString = """ This is a long string and will span across
multiple lines.
This is a very good tool for readability."""
Return a random number between 1 and 10:
Math.floor((Math.random() * 10) + 1);
Return a random number between 1 and 100:
Math.floor((Math.random() * 100) + 1);