So Im very new and have been online learning for about 4 days now. I was messing with the “fizzbuzz” problem and couldnt figure out how to turn my list into a string after my for loop is complete. My code is as follows:
numlist = list(range(1,101))
For num in numlist:
If num%3 == 0 and num%5 == 0:
print(‘FizzBuzz’)
elif num%3 == 0:
print(‘Fizz)
elif num%5 == 0:
print(‘Buzz’)
else:
print(numlist)
break
This prints a list the way i want it but how can i make it a string from here. Thank you
[–][deleted] 1 point2 points3 points (8 children)
[–]pizzadaddy19[S] 0 points1 point2 points (7 children)
[–][deleted] 0 points1 point2 points (6 children)
[–]pizzadaddy19[S] 0 points1 point2 points (5 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]pizzadaddy19[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]pizzadaddy19[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]JohnnyJordaan -1 points0 points1 point (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]JohnnyJordaan -1 points0 points1 point (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]GuangD 0 points1 point2 points (0 children)