Buggy python submission (verdict: Runtime Error):
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	static class Point {
		double x;
		double y;
		public Point(double x, double y) {
			this.x = x;
			this.y = y;
		}
		public String toString() {
			return String.format("%.8f %.8f", x, y);
		}
	}
	
	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		reader.close();		
		getKochCurve(n, new Point(0, 0), new Point(100, 0));
	}

	private static void getKochCurve(int n, Point start, Point end) {
		System.out.println(start);
		getKochCurve(0, n, start, end);
		System.out.println(end);
	}

	private static void getKochCurve(int i, int n, Point start, Point end) {		
		if (i < n) {
			Point firstPoint = getPoint(start, end, 1.0/3.0);
			Point thirdPoint = getPoint(start, end, 2.0/3.0);
			Point secondPoint = getSecondPoint(start, end, firstPoint, thirdPoint);
			getKochCurve(i + 1, n, start, firstPoint);
			System.out.println(firstPoint);
			getKochCurve(i + 1, n, firstPoint, secondPoint);
			System.out.println(secondPoint);
			getKochCurve(i + 1, n, secondPoint, thirdPoint);
			System.out.println(thirdPoint);
			getKochCurve(i + 1, n, thirdPoint, end);
		}
	}

	private static Point getPoint(Point start, Point end, double d) {
		double deltaX = end.x - start.x;
		double deltaY = end.y - start.y;
		deltaX *= d;
		deltaY *= d;
		return new Point(start.x + deltaX, start.y + deltaY);
	}

	private static Point getSecondPoint(Point start, Point end, Point second, Point third) {
		double deltaX = third.x - second.x;
		double deltaY = third.y - second.y;
		double len = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));		
		double x;
		double y;		
		if (deltaY == 0) {
			x = start.x + (end.x - start.x) / 2;
			y = second.y + Math.sqrt((Math.pow(len, 2) - Math.pow(len / 2.0, 2)));
		} else if (start.x < end.x && start.y < end.y) {
			x = start.x;
			y = third.y;
		} else if (start.x < end.x && start.y > end.y) {
			x = end.x;
			y = second.y;
		} else if (start.x > end.x && start.y < end.y) {
			x = end.x;
			y = second.y;
		} else {
			x = start.x;
			y = third.y;
		}
		return new Point(x, y);
	}
}


Fixed submission:
import math
class Point:
	def __init__(self,x,y):
		self.x=x
		self.y=y
	def __str__(self):
		return str(self.x)+' '+str(self.y)
	
def koch(n,a,b):
	if n==0: return
	s=Point(0,0)
	t=Point(0,0)
	u=Point(0,0)
	th=math.pi*60/180
	s.x=(2*a.x+1*b.x)/3
	s.y=(2*a.y+1*b.y)/3
	t.x=(1*a.x+2*b.x)/3
	t.y=(1*a.y+2*b.y)/3
	u.x=(t.x-s.x)*math.cos(th)-(t.y-s.y)*math.sin(th)+s.x
	u.y=(t.x-s.x)*math.sin(th)+(t.y-s.y)*math.cos(th)+s.y
	
	koch(n-1,a,s)
	print(s)
	koch(n-1,s,u)
	print(u)
	koch(n-1,u,t)
	print(t)
	koch(n-1,t,b)

n=int(input())
a=Point(0,0)
b=Point(100,0)
print(a)
koch(n,a,b)
print(b)

Buggy python submission (verdict: Runtime Error):
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	static class Point {
		double x;
		double y;
		public Point(double x, double y) {
			this.x = x;
			this.y = y;
		}
		public String toString() {
			return String.format("%.8f %.8f", x, y);
		}
	}
	
	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		reader.close();		
		getKochCurve(n, new Point(0, 0), new Point(100, 0));
	}

	private static void getKochCurve(int n, Point start, Point end) {
		System.out.println(start);
		getKochCurve(0, n, start, end);
		System.out.println(end);
	}

	private static void getKochCurve(int i, int n, Point start, Point end) {		
		if (i < n) {
			Point firstPoint = getPoint(start, end, 1.0/3.0);
			Point thirdPoint = getPoint(start, end, 2.0/3.0);
			Point secondPoint = getSecondPoint(start, end, firstPoint, thirdPoint);
			getKochCurve(i + 1, n, start, firstPoint);
			System.out.println(firstPoint);
			getKochCurve(i + 1, n, firstPoint, secondPoint);
			System.out.println(secondPoint);
			getKochCurve(i + 1, n, secondPoint, thirdPoint);
			System.out.println(thirdPoint);
			getKochCurve(i + 1, n, thirdPoint, end);
		}
	}

	private static Point getPoint(Point start, Point end, double d) {
		double deltaX = end.x - start.x;
		double deltaY = end.y - start.y;
		deltaX = deltaX * d;
		deltaY = deltaY * d;				
		return new Point(start.x + deltaX, start.y + deltaY);
	}

	private static Point getSecondPoint(Point start, Point end, Point second, Point third) {
		double deltaX = third.x - second.x;
		double deltaY = third.y - second.y;
		double len = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));		
		double x;
		double y;		
		if (deltaY == 0) {
			x = start.x + (end.x - start.x) / 2;
			if (start.x < end.x) {
				y = second.y + Math.sqrt((Math.pow(len, 2) - Math.pow(len / 2.0, 2)));
			} else {
				y = second.y - Math.sqrt((Math.pow(len, 2) - Math.pow(len / 2.0, 2)));
			}
		} else if (start.x < end.x && start.y < end.y) {
			x = start.x;
			y = third.y;
		} else if (start.x < end.x && start.y > end.y) {
			x = end.x;
			y = second.y;
		} else if (start.x > end.x && start.y < end.y) {
			x = end.x;
			y = second.y;
		} else {
			x = start.x;
			y = third.y;
		}
		return new Point(x, y);
	}
}


Fixed submission:
import math
class Point:
	def __init__(self,x,y):
		self.x=x
		self.y=y
	def __str__(self):
		return str(self.x)+' '+str(self.y)
	
def koch(n,a,b):
	if n==0: return
	s=Point(0,0)
	t=Point(0,0)
	u=Point(0,0)
	th=math.pi*60/180
	s.x=(2*a.x+1*b.x)/3
	s.y=(2*a.y+1*b.y)/3
	t.x=(1*a.x+2*b.x)/3
	t.y=(1*a.y+2*b.y)/3
	u.x=(t.x-s.x)*math.cos(th)-(t.y-s.y)*math.sin(th)+s.x
	u.y=(t.x-s.x)*math.sin(th)+(t.y-s.y)*math.cos(th)+s.y
	
	koch(n-1,a,s)
	print(s)
	koch(n-1,s,u)
	print(u)
	koch(n-1,u,t)
	print(t)
	koch(n-1,t,b)

n=int(input())
a=Point(0,0)
b=Point(100,0)
print(a)
koch(n,a,b)
print(b)