We can get point layer coordinates through the following code, but I want to know the coordinates of Line or MultiLine. How to get these coordinates?

```py
layer = QgsProject.instance().mapLayersByName("layerName")[0]

features = layer.getFeatures()

for feature in features:
  geom = feature.geometry()
  print(geom.asPoint().x(), geom.asPoint().y())

```