37,720
社区成员
发帖
与我相关
我的任务
分享
for( i=1; i<=100; i++ )
{
printf("hello");
}
那你是不是感觉这段C语言里的 I 也没有用 ??
for i in range(6):
i
print 'hello'
来点BT的,让自己高兴
for i in ['hello'] * 6:
print i
Ruby就优雅多了,如果你有洁癖的话
6.times {
puts 'hello'
}
想用到i也可以
6.times { |i|
puts i, 'hello'
}
for _ in range(6): # 用不到的循环变量
print("hi")
last_name, _ , _= ["李", "明", "老师"] # 只关心姓, 不要名和职业