0
help me please
I need program when I input 5 output : ***** * * ***** * * ***** with formula : n-1 % 2 = 0 and n >= 5 when user not follow formula this program return to n again please help
2 Answers
+ 3
Here It is
num = int(input("Enter the Number : "))
for n in range(1, num+1):
if (n-1) % 2 == 0 or n >= num:
print ("*****")
else:
print ("* *")
Formula which you are suggesting because of (and) condition will never be true. So need to use (or) instead of (and).
0
thanks



