<jupyter_start><jupyter_text>Solutions exercise 03===<jupyter_code># 1.a
number = 3
if number % 3 == 0:
    print('number is divisible by 3')
# 1.b
word = 'test'
if 'e' in word and len(word) < 5:
    print('e in "{}" and "{}" < 5'.format(word, word))
# 2.1
numbers = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
# or:
numbers = list(range(0,21))

# iterate all numbers in the list
for number in numbers:
    
    # case for zero
    if number == 0:
        print('found zero!')
        
    # case for even numbers
    elif number % 2 == 0:
        print('{} is an even number!'.format(number))
        # special case for two (even AND a prime)
        if number == 2:
            print('{} is a prime number!'.format(number))
    
    # case for prime numbers
    else:
        # we start with the idea that the number
        # is a prime and then check whether the opposite is true
        prime = True
        
        # iterate all numbers we had until now and
        # check whether number is divisible by one of them
        for factor in numbers[2:number]: 
            if number % factor == 0:
                # if yes, set prime to false
                prime = False
        
        # If we did not find a number that fulfills our 
        # condition, the current number is a prime
        if prime:
            print('{} is a prime number!'.format(number))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11268603827072998, 'fraction_numerical': 0.03756201275690999, 'mean_word_length': 2.137777777777778, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '209094', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 476, 'n_tokens_neox': 436, 'n_words': 166, 'path': '03-solutions.ipynb', 'repo_name': 'JanaLasser/python-introduction', 'size': '1411'}