File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,11 @@ String
286
286
< list > = textwrap.wrap(< str > , width) # Nicely breaks string into lines.
287
287
```
288
288
289
+ ``` python
290
+ < str > = bin (< int > ) # Binary representation starting with '0b'.
291
+ < str > = hex (< int > ) # Hexadecimal representation starting with '0x'.
292
+ ```
293
+
289
294
### Char
290
295
``` python
291
296
< str > = chr (< int > ) # Converts int to unicode char.
Original file line number Diff line number Diff line change @@ -389,6 +389,9 @@ <h2 id="string"><a href="#string" name="string">#</a>String</h2>
389
389
< pre > < code class ="python language-python hljs "> <bool> = <str>.isnumeric() < span class ="hljs-comment "> # True if str contains only numeric characters.</ span >
390
390
<list> = textwrap.wrap(<str>, width) < span class ="hljs-comment "> # Nicely breaks string into lines.</ span >
391
391
</ code > </ pre >
392
+ < pre > < code class ="python language-python hljs "> <str> = bin(<int>) < span class ="hljs-comment "> # Binary representation starting with '0b'.</ span >
393
+ <str> = hex(<int>) < span class ="hljs-comment "> # Hexadecimal representation starting with '0x'.</ span >
394
+ </ code > </ pre >
392
395
< h3 id ="char "> Char</ h3 >
393
396
< pre > < code class ="python language-python hljs "> <str> = chr(<int>) < span class ="hljs-comment "> # Converts int to unicode char.</ span >
394
397
<int> = ord(<str>) < span class ="hljs-comment "> # Converts unicode char to int.</ span >
You can’t perform that action at this time.
0 commit comments