Python: Simple for loop
#!/usr/bin/python
import sys
c = "I am a best player"
a = range(1,11)
print a
for b in a:
print c
OUTPUT:
[root@mysql Scripts]# python For.py
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
import sys
c = "I am a best player"
a = range(1,11)
print a
for b in a:
print c
OUTPUT:
[root@mysql Scripts]# python For.py
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
I am a best player
Comments
Post a Comment