Python - program to print steps -
I am creating a program, which is as follows <.
How many steps? 4__ _ | _ | _ ________ | How many steps? 1___ Using
_ and |
So far I have found this as my code (too much waste)
i = int (input ('how many steps?')) Spc = (' ') S =' '* inp z =' \ n '' '' '_' print ('__' + z * i + '__' * i)
Will you be able to give some help on this?
Thanks
You can use Note: This works Is n> 0 . for
loop Can I print the head (N-1): print ("" * (* *) (for the "__") # range print ("__"):
n = int (input ('how many steps?')) I 1) + "|" + "_") Print ("__" * n + "|") # Last step
Comments
Post a Comment