For example if I have
x = "12345;9876"
y = ?
z = ?
how can i make it so y is only the part before the semicolon and z is the part after the semicolon
For example if I have
x = "12345;9876"
y = ?
z = ?
how can i make it so y is only the part before the semicolon and z is the part after the semicolon
y, z = x.split(';')
This uses two features:
x = "12345;9876"
y, z=x.split(';')
You can try this -
x = "12345;9876"
y = x.split(';')[0]
z = x.split(';')[1]
print(y)
print(z)
Result:
12345 # This is y
9876 # This is z