<jupyter_start><jupyter_text>Exercise 1<jupyter_code>num = int(input())
for i in range(1,num + 1):
    for j in range(1,i+1):
        print(j,end = " ")
    print()
%time<jupyter_output>5
1 
1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5 
Wall time: 0 ns<jupyter_text>Exercise 2<jupyter_code>num = 2
for i in range(2,50):
    j=2
    while (j <= (i/2)):
        if (i%j == 0):
            break
        j+=1
    if(j > i/j):
        print(i,"is a prime number")
print("Bye bye!!")<jupyter_output>2 is a prime number
3 is a prime number
5 is a prime number
7 is a prime number
11 is a prime number
13 is a prime number
17 is a prime number
19 is a prime number
23 is a prime number
29 is a prime number
31 is a prime number
37 is a prime number
41 is a prime number
43 is a prime number
47 is a prime number
Bye bye!!<jupyter_text>Exercise 3<jupyter_code>num = int(input("Enter a number: "))
fact = 1
if num < 0:
    print("Sorry, factorial does not exist for negative numbers")
elif num == 0:
    print("The factorial of 0 is 1")
else:
    for i in range(1,num+1):
        fact = fact * i
    print("factorial of", num, "is",fact)<jupyter_output>Enter a number: 5
factorial of 5 is 120<jupyter_text>Exercise 4<jupyter_code>num = int(input("Enter the number to be checked: "))
flag  = 0
if num > 1:
    for i in range (2,int(num/2)+1):
        # addition of one because the range(2,2) returns nothing
        # while using 4 as num
        if ((num % i) == 0):
            flag = 1
            break
    if flag == 1:
        print(num,"is not a prime number")
    else:
        print(num,"is a prime number")
    print(i)
else:
    print("Entered number is <= 1, execute again!")
for i in range(5,5):
    print(i)<jupyter_output>0
{'fraction_non_alphanumeric': 0.11435239206534423, 'fraction_numerical': 0.050175029171528586, 'mean_word_length': 2.7775330396475773, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 15, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '120642', 'license': 'MIT', 'n_tokens_mistral': 681, 'n_tokens_neox': 627, 'n_words': 242, 'path': 'Week_4/Week_4.ipynb', 'repo_name': 'clementshade/CSC102', 'size': '1714'}