Sideway
output.to from Sideway
Draft for Information Only

Content

Python Textual Operations
 Python Textual Literals
 Python Textual Methods
 Source and Reference

Python Textual Operations

Python textual operations.

Python Textual Literals

Literalsstringbytesbytearray Single quotes'allows embedded "double" quotes'b'allows embedded "double" quotes'No dedicated literal syntax Double quotes"allows embedded 'single' quotes"b"allows embedded 'single' quotes"No dedicated literal syntax Triple quoted'''Three single quotes''', """Three double quotes"""b'''Three single quotes''', b"""Three double quotes"""No dedicated literal syntax

Python Textual Methods

Python Textual Methods
Methodsstringbytesbytearray classπ‘ π‘‘π‘Ÿ=str(object=''), 𝑏𝑦𝑑𝑒𝑠=str(​object=b'', encoding='utf-8', errors='strict')𝑏𝑦𝑑𝑒𝑠=bytes(​[source[, encoding[, errors]]])π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦=bytearray(​[source[, encoding[, errors]]]) classmethod*.fromhex(​​string) π‘π‘¦π‘‘𝑒𝑠=bytes.fromhex(​​string)π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦=bytearray.fromhex(​string) π‘ π‘‘π‘Ÿ=*.hex([sep[, bytes_per_sep]]) π‘ π‘‘π‘Ÿ=𝑏𝑦𝑑𝑒𝑠.hex(​[sep[, bytes_per_sep]])π‘ π‘‘π‘Ÿ=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.hex([sep[, bytes_per_sep]]) *=*.capitalize()π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.*  π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.casefold()    π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.center(​width[, fillchar])𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.center(​width[, fillbyte])π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.center(​width[, fillbyte]) 𝑖𝑛𝑑=*.count(​sub[, start[, end]])𝑖𝑛𝑑=π‘ π‘‘π‘Ÿ.*𝑖𝑛𝑑=𝑏𝑦𝑑𝑒𝑠.*𝑖𝑛𝑑=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* π‘ π‘‘π‘Ÿ=*.decode(​encoding="utf-8", errors="strict") π‘ π‘‘π‘Ÿ=𝑏𝑦𝑑𝑒𝑠.*π‘ π‘‘π‘Ÿ=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* 𝑏𝑦𝑑𝑒𝑠=*.encode(​encoding="utf-8", errors="strict")𝑏𝑦𝑑𝑒𝑠=π‘ π‘‘π‘Ÿ.*   π‘π‘œπ‘œπ‘™=*.π‘ π‘‘π‘Ÿ.endswith(​suffix[, start[, end]])π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.*π‘π‘œπ‘œπ‘™=𝑏𝑦𝑑𝑒𝑠.*π‘π‘œπ‘œπ‘™=π‘ π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *=*.expandtabs(​tabsize=8)π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* 𝑖𝑛𝑑=*.find(sub[, start[, end]])𝑖𝑛𝑑=π‘ π‘‘π‘Ÿ.*𝑖𝑛𝑑=𝑏𝑦𝑑𝑒𝑠.*𝑖𝑛𝑑=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.*  π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.format(*args, **kwargs)    π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.format_map(​mapping)   𝑖𝑛𝑑=*.index(​sub[, start[, end]])𝑖𝑛𝑑=π‘ π‘‘π‘Ÿ.*𝑖𝑛𝑑=𝑏𝑦𝑑𝑒𝑠.*𝑖𝑛𝑑=π‘ π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* π‘π‘œπ‘œπ‘™=*.isalnum()π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.*π‘π‘œπ‘œπ‘™=𝑏𝑦𝑑𝑒𝑠.*π‘π‘œπ‘œπ‘™=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* π‘π‘œπ‘œπ‘™=*.isalpha()π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.*π‘π‘œπ‘œπ‘™=𝑏𝑦𝑑𝑒𝑠.*π‘π‘œπ‘œπ‘™=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* π‘π‘œπ‘œπ‘™=*.isascii()π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.*π‘π‘œπ‘œπ‘™=𝑏𝑦𝑑𝑒𝑠.*π‘π‘œπ‘œπ‘™=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.*  π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.isdecimal()   π‘π‘œπ‘œπ‘™=*.isdigit()π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.*π‘π‘œπ‘œπ‘™=𝑏𝑦𝑑𝑒𝑠.*π‘π‘œπ‘œπ‘™=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.*  π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.isidentifier()   π‘π‘œπ‘œπ‘™=*.islower()π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.*π‘π‘œπ‘œπ‘™=𝑏𝑦𝑑𝑒𝑠.*π‘π‘œπ‘œπ‘™=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.*  π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.isnumeric()    π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.isprintable()   π‘π‘œπ‘œπ‘™=*.isspace()π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.*π‘π‘œπ‘œπ‘™=𝑏𝑦𝑑𝑒𝑠.*π‘π‘œπ‘œπ‘™=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* π‘π‘œπ‘œπ‘™=*.istitle()π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.*π‘π‘œπ‘œπ‘™=𝑏𝑦𝑑𝑒𝑠.*π‘π‘œπ‘œπ‘™=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* π‘π‘œπ‘œπ‘™=*.isupper()π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.*π‘π‘œπ‘œπ‘™=𝑏𝑦𝑑𝑒𝑠.*π‘π‘œπ‘œπ‘™=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *=*.join(iterable)π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.*  π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.ljust(width[, fillchar])𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.ljust(​width[, fillbyte])π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.ljust(​width[, fillbyte]) π‘ π‘‘π‘Ÿ1=*.lower()π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*π‘π‘œπ‘œπ‘™=𝑏𝑦𝑑𝑒𝑠.*π‘π‘œπ‘œπ‘™=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *=*.lstrip(​[chars])π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* staticπ‘ π‘‘π‘Ÿπ‘‘π‘π‘™=π‘ π‘‘π‘Ÿ.maketrans(x[, y[, z]])𝑏𝑦𝑑𝑒𝑠𝑑𝑏𝑙=𝑏𝑦𝑑𝑒𝑠.maketrans(from, to)π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦π‘‘π‘π‘™=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.maketrans(from, to) *𝑑𝑒𝑝𝑙𝑒=*.partition(sep)π‘ π‘‘π‘Ÿπ‘‘π‘’π‘π‘™π‘’=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠𝑑𝑒𝑝𝑙𝑒=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦π‘‘π‘’π‘π‘™π‘’=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *=*.replace(old, new[, count])π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* 𝑖𝑛𝑑=*.rfind(sub[, start[, end]])𝑖𝑛𝑑=π‘ π‘‘π‘Ÿ.*𝑖𝑛𝑑=𝑏𝑦𝑑𝑒𝑠.*𝑖𝑛𝑑=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* 𝑖𝑛𝑑=*.rindex(sub[, start[, end]])𝑖𝑛𝑑=π‘ π‘‘π‘Ÿ.*𝑖𝑛𝑑=𝑏𝑦𝑑𝑒𝑠.*𝑖𝑛𝑑=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.*  π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.rjust(width[, fillchar])𝑠𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.rjust(width[, fillbyte])π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.rjust(width[, fillbyte]) *𝑑𝑒𝑝𝑙𝑒=*.rpartition(​sep)π‘ π‘‘π‘Ÿπ‘‘π‘’π‘π‘™π‘’=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠𝑑𝑒𝑝𝑙𝑒=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦π‘‘π‘’π‘π‘™π‘’=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *𝑙𝑖𝑠𝑑=*.rsplit(​sep=None, maxsplit=-1)π‘ π‘‘π‘Ÿπ‘™π‘–π‘ π‘‘=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠𝑙𝑖𝑠𝑑=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦π‘™π‘–π‘ π‘‘=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *=*.rstrip(​[chars])π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *𝑙𝑖𝑠𝑑=*.split(​sep=None, maxsplit=-1)π‘ π‘‘π‘Ÿπ‘™π‘–π‘ π‘‘=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠𝑙𝑖𝑠𝑑=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦π‘™π‘–π‘ π‘‘=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *𝑙𝑖𝑠𝑑=*.splitlines(​[keepends])π‘ π‘‘π‘Ÿπ‘™π‘–π‘ π‘‘=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠𝑙𝑖𝑠𝑑=π‘ π‘‘π‘Ÿ.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦π‘™π‘–π‘ π‘‘=π‘ π‘‘π‘Ÿ.* π‘π‘œπ‘œπ‘™=*.startswith(​prefix[, start[, end]])π‘π‘œπ‘œπ‘™=π‘ π‘‘π‘Ÿ.*π‘π‘œπ‘œπ‘™=𝑏𝑦𝑑𝑒𝑠.*π‘π‘œπ‘œπ‘™=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *=*.strip(​[chars])π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *=*.swapcase()π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *=*.title()π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.*  π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.translate(​table)𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.translate(​table, /, delete=b'')π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.translate(​table, /, delete=b'') *=*.upper()π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.* *=*.zfill(width)π‘ π‘‘π‘Ÿ1=π‘ π‘‘π‘Ÿ.*𝑏𝑦𝑑𝑒𝑠1=𝑏𝑦𝑑𝑒𝑠.*π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦1=π‘π‘¦π‘‘π‘’π‘Žπ‘Ÿπ‘Ÿπ‘Žπ‘¦.*

Source and Reference


Β©sideway

ID: 210100021 Last Updated: 1/21/2021 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Reference 79

Computer

Hardware 249

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 429

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019