#python Interview Question #fizzbuzz
▻https://hackernoon.com/python-basics-8-fizzbuzz-441e97c6c767?source=rss----3a8144eabfe3---4
▻https://medium.com/media/bd7f5cf49d59a279d36442e185efa6e5/hrefWrite a program that prints the numbers from 1 to 20. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.Method 1: Concatenating Stringsfor num in range(1,21): string = "" if num % 3 == 0: string = string + "Fizz" if num % 5 == 0: string = string + "Buzz" if num % 5 != 0 and num % 3 != 0: string = string + str(num) print(string)Method 2: Use if, elif, and elsefor num in range(1, 21): if num % 3 == 0 and num % 5 == 0: print(’FizzBuzz’) elif num % 3 == 0: print(’Fizz’) elif num % 5 == 0: (...)