Added parenthesis, updated to Tuple. (#31085)
Added parenthesis to print function to align file. Changed #2 from a list to a tuple.
This commit is contained in:
committed by
Randell Dawson
parent
d7a003dc22
commit
5302b7b351
@ -12,7 +12,7 @@ If the iterable contains any non-string values, it raises a TypeError exception.
|
|||||||
|
|
||||||
1) Join a ist of strings with `":"`
|
1) Join a ist of strings with `":"`
|
||||||
```python
|
```python
|
||||||
print ":".join(["freeCodeCamp", "is", "fun"])
|
print( ":".join(["freeCodeCamp", "is", "fun"]))
|
||||||
```
|
```
|
||||||
Output
|
Output
|
||||||
```shell
|
```shell
|
||||||
@ -21,7 +21,7 @@ freeCodeCamp:is:fun
|
|||||||
|
|
||||||
2) Join a tuple of strings with `" and "`
|
2) Join a tuple of strings with `" and "`
|
||||||
```python
|
```python
|
||||||
print " and ".join(["A", "B", "C"])
|
print(" and ".join(("A", "B", "C")))
|
||||||
```
|
```
|
||||||
Output
|
Output
|
||||||
```shell
|
```shell
|
||||||
@ -30,7 +30,7 @@ A and B and C
|
|||||||
|
|
||||||
3) Insert a `" "` after every character in a string
|
3) Insert a `" "` after every character in a string
|
||||||
```python
|
```python
|
||||||
print " ".join("freeCodeCamp")
|
print(" ".join("freeCodeCamp"))
|
||||||
```
|
```
|
||||||
Output:
|
Output:
|
||||||
```shell
|
```shell
|
||||||
|
Reference in New Issue
Block a user