BABright Andohinbrrrpcodes.hashnode.dev路Aug 15, 2023 路 1 min read100 days of python ExercisesDay 12: Python exercise that involves calculating the factorial of a number using a loop. def factorial(n): if n < 0: return "Factorial is not defined for negative numbers." result = 1 for i in range(1, n + 1): result *= i r...00
BABright Andohinbrrrpcodes.hashnode.dev路Aug 14, 2023 路 1 min read100 days of python ExercisesDay 11: Unpacking Any iterable i.e. list, tuple, or set can be unpacked using the assignment operator as below. x = [1, 2, 3] a, b, c = x a >>>1 b >>>200
BABright Andohinbrrrpcodes.hashnode.dev路Aug 13, 2023 路 1 min read100 days of Python ExercisesDay 10: Playback speed Some people have a habit of lecturing and speaking rather quickly, and it鈥檇 be nice to slow them down, a la YouTube鈥檚 0.75 playback speed, or even by having them pause between words. Exercise character = input("Anything of your...00
BABright Andohinbrrrpcodes.hashnode.dev路Aug 12, 2023 路 1 min read100 days of Python ExerciseDay 9: Converting text to emoji Emojis play a pivotal role in conveying expressions and emotions across social media platforms. For many programmers, the intriguing prospect of crafting Python code to dynamically generate emojis has likely crossed th...00
BABright Andohinbrrrpcodes.hashnode.dev路Aug 11, 2023 路 1 min read100 days of Python ExerciseDay 8: Exercise on Einsteins' formula Today's exercise is based on the famous energy formula m = int(input("m: ")) def einstein(): return m *300000000**2 result = einstein() print("E: "+str(result)) #this is a code for the formula any mass you in...00