How do I print A number for the same number of times with while loop inside a function? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do I print A number for the same number of times with while loop inside a function?

I want to print the entered number, the same number of times using a while loop. The code has to read a value from user and then pass it to a function which then does the printing work. And also how can I find the factorial of the number using the same code structure? https://code.sololearn.com/c7ZyVYW9KlZo/?ref=app

14th Dec 2019, 8:14 AM
SaFFire1
SaFFire1 - avatar
4 Answers
+ 2
https://code.sololearn.com/cj0QhnpBva63/?ref=app Check this.
14th Dec 2019, 8:19 AM
๐Ÿ‡ Alex Tuศ™inean ๐Ÿ’œ
๐Ÿ‡ Alex Tuศ™inean ๐Ÿ’œ - avatar
+ 3
๐Ÿ’œ Alex Tusinean ๐Ÿ‡ Thanks a ton. ๐Ÿ˜Š
14th Dec 2019, 8:21 AM
SaFFire1
SaFFire1 - avatar
+ 3
๐Ÿ’œ Alex Tusinean ๐Ÿ‡ you're awesome ๐Ÿ‘Œ
14th Dec 2019, 2:52 PM
SaFFire1
SaFFire1 - avatar
+ 2
SaFFire1 you're welcome :) Check again the code, I made it work for negative numbers too.
14th Dec 2019, 8:23 AM
๐Ÿ‡ Alex Tuศ™inean ๐Ÿ’œ
๐Ÿ‡ Alex Tuศ™inean ๐Ÿ’œ - avatar