To practice conditions, loops, and string manipulation, here are some practical exercises to do:
Objective: Work on string manipulation and loops.
Instructions:
for loop to traverse the string.if condition to ignore spaces.Example:
Objective: Use loops and conditions.
Instructions:
for loop to traverse the range of numbers.if...else condition to determine the parity of each number.Example:
Objective: Work on conditions and string manipulation.
!, @, #, $, etc.).Instructions:
isupper(), islower(), isdigit().if...elif...else conditions to check the criteria.Example:
Objective: Use loops and conditions to implement a classic algorithm.
Instructions:
while loop to implement Euclid's algorithm:
Example:
Objective: Advanced string manipulation, loops and conditions.
Instructions:
split() to divide the sentence into words.Example: