+ 1

How can I create a python loop that will print 1 to 5 and in between each printed number there will be a decoration like(==)

Python

25th Jan 2022, 11:51 PM
David Boateng
3 Antworten
+ 5
Do you want; 1 == 2 == 3 == 4 == 5 Or 1==2==3==4==5 Without a loop print(*range(1, 6), sep='\n==\n') Or print(*range(1, 6), sep='==') With a loop for n in range(1, 5): print(n, end='\n==\n') print(n+1) Or for n in range(1, 5): print(n, end='==') print(n+1)
26th Jan 2022, 12:22 AM
ChaoticDawg
ChaoticDawg - avatar
+ 3
Ohk I see. Thanks
26th Jan 2022, 12:23 AM
David Boateng
+ 1
The first one
26th Jan 2022, 12:22 AM
David Boateng