title: Fizzbuzz (Turning my output to a string?)
body: <p>New here and hoping I can help as much as I am helped. Basically, I have been tasked with writing a fizzbuzz program in Python and so far so good except for some feedback I received. </p>
  
  <p>Now I have to ensure that the output of my program comes across horizontally and is not printed vertically on new lines. From my understanding, and my lecturers hinting, I need to turn function to produce strings and remove the print statements as well.</p>
  
  <p>Code is below:</p>
  
  <pre><code>def fizzbuzz1 (num):
      for num in range(1, num): 
          if (num%3 == 0) and (num%5 == 0): 
               print("Fizzbuzz")
          elif ((num % 3) == 0):
               print("Fizz")
          elif ((num % 5) == 0):
               print("buzz")
          else :
               print (num)
  
  def main (): 
      while True: #Just to keep my program up and running while I play with it
      num = input ("please type a number: ") #
      num = int (num)
      print ("Please select an type what option you wish to try: A) Is this Fizz or Buzz? B) Count saying fizz/buzz/fizzbuzz") 
      opt = input ("Please type A or B and press enter: ")
      if opt == "A": 
          fizzbuzz(num)
      elif (opt == "a")
          fizzbuzz(num)
      elif (opt == "B"):
          print (fizzbuzz1(num))
      elif (opt == "b"):
          print (fizzbuzz1(num))
  
  main ()
  </code></pre>
  
  <p>I have tried a whole host of things, and my lecturer doesn't seem too interested in help me. Womp. I was recommended to review this exercise were I played with this piece of code:</p>
  
  <pre><code>def func(num):
  value = ‘’
  for x in range(...):
      if   .... == .... :
          value += str(x) + ‘, ‘
  return value[…]# You need to remove the last comma and the space
  </code></pre>
  
  <p>When I do play with this code, I do get numbers to go across the screen. But for the life of me I can not seem to incorporate what I have written with elements from this. Where am I going astray? </p>
  
  <p>Thank you for any and all your advice/help. If you do choose to reply, please keep it as simple as possible for me.</p>
  
  <p>Cheers.</p>
  
  <p>Update: Thanks everyone for your suggestions, lots of thimgs I didnt know to try! </p>
  
  <p>I also found a thread here at: <a href="https://stackoverflow.com/questions/18458024/cant-figure-out-how-to-print-horizontally-in-python">Can&#39;t figure out how to print horizontally in python?</a></p>
  
  <p>Which has answers to a similar issue.</p>