Guest User

Untitled

a guest
May 24th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. *************
  2. * name_here *
  3. *************
  4.  
  5. def style_1():
  6. print "*" * (length_of_name + 4)
  7. print "*", name, "*"
  8. print "*" * (length_of_name + 4)
  9.  
  10.  
  11. def style_2():
  12. print "#" * (length_of_name + 4)
  13. print "#", name, "#"
  14. print "#" * (length_of_name + 4)
  15.  
  16.  
  17. def style_3():
  18. print "$" * (length_of_name + 4)
  19. print "$", name, "$"
  20. print "$" * (length_of_name + 4)
  21.  
  22.  
  23. def style_4():
  24. print "^" * (length_of_name + 4)
  25. print "^", name, "^"
  26. print "^" * (length_of_name + 4)
  27.  
  28.  
  29. def style_5():
  30. print ":" * (length_of_name + 4)
  31. print ":", name, ":"
  32. print ":" * (length_of_name + 4)
  33.  
  34.  
  35. def style_selection():
  36. if style == "*":
  37. style_1()
  38. elif style == "#":
  39. style_2()
  40. elif style == "$":
  41. style_3()
  42. elif style == "^":
  43. style_4()
  44. elif style == ":":
  45. style_5()
  46. elif style == "EXIT":
  47. print "Thank you for using the Name Banner Program!"
  48. exit()
  49.  
  50. while 1:
  51. name = raw_input("What is your name: ")
  52. style = raw_input("What is your style (*, #, $, ^, :): ")
  53. length_of_name = len(name)
  54. style_selection()
  55.  
  56. def frame(name, style_character='*'):
  57. """Frame the name with the style_character."""
  58.  
  59. frame_line = style_character * (len(name) + 4)
  60. print(frame_line)
  61. print('{0} {1} {0}'.format(style_character, name))
  62. print(frame_line)
  63.  
  64. if __name__ == '__main__':
  65.  
  66. frame("holroy")
  67.  
  68. while True:
  69. name = raw_input('Please enter name (or "quit"): ')
  70. if name == 'quit':
  71. break
  72.  
  73. style_character = raw_input('Enter frame character: ')
  74.  
  75. frame(name, style_character)
  76.  
  77. def simplebanner(bannername):
  78. for i in range(len(bannername)+4):
  79. if i<=len(bannername):
  80. print("*",end="")
  81. continue
  82. else:
  83. print("Exiting")
  84.  
  85. print(end="n")
  86. print("*",bannername,"*")
  87. for i in range(len(bannername)+4):
  88. if i<=len(bannername):
  89. print("*",end="")
  90. continue
  91.  
  92. name = input("Enter name :")
  93. simplebanner(name)
Add Comment
Please, Sign In to add comment