At this point, we have our position saved into a variable we named pos. We now want to make use of the function mc.player.setPos(x, y, z) to teleport ourselves to a new location! This function takes as input the x, y, and z coordinates we want to teleport to!
If we add the line mc.player.setPos(pos.x, pos.y, pos.z) to the end of our application, our character will teleport... to the same exact location we are already in. Indeed, we likely won't even notice a change.
Observe the code on the right. In it, we call mc.player.setPos(pos.x, pos.y+100, pos.z). The important change is the +100 we are passing to the y position. This changes our position to the same x coordinate, same z coordinate, and a y coordinate that is 100 blocks different that our current position. Copy/paste it into your script.py file, change the ip and username, and then run it and see what happens!
from mcpi import minecraft
mc = minecraft.Minecraft.create(address="127.0.0.1", name="steve")
pos = mc.player.getTilePos()
mc.player.setPos(pos.x, pos.y+100, pos.z)