100 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...Aug 15, 2023·1 min read
100 days of Python ExerciseDay 7: Checking the divisibility of a number In today's episode, we would be checking whether any number is divisible by a set of numbers using if and else EXERCISE: Check whether a number is divisible by 2 or 3 if not check which one it should retur...Aug 10, 2023·1 min read
100 days of Python ExercisesDAY 6: Using Functions We will be taking an exercise on functions but before that, we have to take a quick look at functions again. FUNCTION: Let's say you have a logic you would be using in your code but you don't want to be rewriting the whole thin...Aug 9, 2023·1 min read
100 days of Python ExercisesDAY 5: Calling Values out of Dictionaries. In today's episode, we have an exercise on creating dictionaries and calling any value out of it. First, what is a dictionary as used in Python? A dictionary in Python is a collection of key values, used to ...Aug 8, 2023·1 min read
100 days of Python ExercisesDay 4: Use Iteration to list current and previous numbers. Today's episode is based on applying what we have looked at in the previous days. This exercise can be done in many ways but I decided to go with what I used because it looked very short and ...Aug 7, 2023·1 min read
100 days of Python ExercisesDay 3: Nested Loops Nested loops is simply a loop inside another loop.The nested loop can either be the for loop or while loop . The outer loop can contain the for loop and the inner loop contains the while loop. EXERCISE : Write a nested for loop pr...Aug 6, 2023·2 min read
100 days of Python ExercisesDAY 2: for loops for definite, (counted) iteration. In today's episode, we are looking at for loops. For loops as we use in Python are used for iterating through lists unlike while loops which are indefinite. The use of various keywords such as break...Aug 5, 2023·1 min read