Paul Sokolovsky
11 years ago
2 changed files with 26 additions and 1 deletions
@ -0,0 +1,16 @@ |
|||
# basic tuple functionality |
|||
x = (1, 2, 3 * 4) |
|||
print(x) |
|||
try: |
|||
x[0] = 4 |
|||
except TypeError: |
|||
print("TypeError") |
|||
print(x) |
|||
try: |
|||
x.append(5) |
|||
except AttributeError: |
|||
print("AttributeError") |
|||
|
|||
print(x[1:]) |
|||
print(x[:-1]) |
|||
print(x[2:3]) |
Loading…
Reference in new issue