Test string slicing.
This commit is contained in:
parent
16f377a2ef
commit
d9f24706ac
14
main.py
14
main.py
@ -1,12 +1,6 @@
|
|||||||
#String tests
|
#String tests
|
||||||
a = "hello world"
|
a = "hello world"
|
||||||
b = """hello
|
#[lw_inc:up_exc]
|
||||||
world"""
|
print(a[2:8])
|
||||||
c = 'world hello!'
|
print(a[:8])
|
||||||
d = '''world
|
print(a[2:])
|
||||||
hello!'''
|
|
||||||
e = "!"
|
|
||||||
print("!" not in a)
|
|
||||||
print(e not in b)
|
|
||||||
print("!" not in c)
|
|
||||||
print(e not in d)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user