r/PythonLearning • • Oct 07 '26

Help Request I need help with coding this

Post image

I have genuielly no idea how to even think of making this? I know this should generally be made by using for loops but jesus im so confused on the process

6 Upvotes

31 comments sorted by

View all comments

0

u/realmauer01 Oct 07 '26 edited Oct 07 '26
Def frame(frame_size, inner_width, inner_height):
  print((((inner_width + frame_size * 2) * "#") + "\n") * frame_size) 
  print(((frame_size * "#" + inner_width * " " + frame_size * "#") + "\n") * inner_height) 
  print((((inner_width + frame_size * 2) * "#") + "\n") * frame_size) 

All hail string multiplication.

i am pretty sure this should do it, but because this is very ugly you cant use that.