PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
s = 'hi'
# a value or variable followed by a comma is a tuple in Python
# this is a tuple
text = ("#", )
print(type(text), text)
# this is a tuple
text = ("#", s)
print(type(text), text)
# the parenthesis are actually not necessary for tuples. the comma is the important part.
# this is also a tuple
text = "#",
print(type(text), text)
# this is also a tuple
text = "#", s
print(type(text), text)
#they're all tuples.
# the comma seems to concatenate in print(), but it also adds a space between, because sep=' ' is the default in print()
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run