View Problem

Perform an action multiple times based on a boolean condition, checked before the first action (WHILE .. DO)

Starting with a variable x=1, Print the sequence "1,2,4,8,16,32,64,128," by doubling x and checking that x is less than 150.
DiskEdit
python
x = 1
while x < 150:
print '%s, ' % x,
x *= 2
DiskEdit
csharp
int x = 1;

while (x < 150)
{
x *= 2;
Console.Write("{0},", x);
}
ExpandDiskEdit
java
int x = 1;
while (x < 150) {
System.out.println(x+",");
x*=2;
}

Submit a new solution for python, csharp, or java
There are 17 other solutions in additional languages (clojure, cpp, erlang, fantom ...)