tanjir
0
Q:

how to print for loop in same line in python

print("geeks", end =" ") 
print("geeksforgeeks") 
12
# A small example using range function
for i in range(1, 11):
  print(i, end="")
2
Just put a , after the print
example:
  print("hallo"),
0
# Python 3 code for printing 
# on the same line printing  
# geeks and geeksforgeeks  
# in the same line 
  
print("geeks", end =" ") 
print("geeksforgeeks") 
  
# array 
a = [1, 2, 3, 4] 
  
# printing a element in same 
# line 
for i in range(4): 
    print(a[i], end =" ")  
0

New to Communities?

Join the community