<jupyter_start><jupyter_text>Say "Hello, World!" With Python<jupyter_code>print("Hello, World!")<jupyter_output><empty_output><jupyter_text>Python If-Else<jupyter_code>n = int(input(""))

if n % 2 != 0 or 6 <= n <= 20:
    print("Weird")
else:
    print("Not Weird")<jupyter_output><empty_output><jupyter_text>Arithmetic Operators<jupyter_code>a = int(input())
b = int(input())

print(a+b)
print(a-b)
print(a*b)<jupyter_output><empty_output><jupyter_text>Python: Division<jupyter_code>a = int(input())
b = int(input())

print(a // b)
print(a / b)<jupyter_output><empty_output><jupyter_text>Loops<jupyter_code>n = int(input())

for i in range (0,n):
    print(i*i)<jupyter_output><empty_output><jupyter_text>Write a function<jupyter_code>def is_leap(year):
    leap = False
    
    if year % 4 == 0:             
        leap = True
        if year % 100 == 0:
            leap = False
            if year % 400 == 0:
                leap = True
    
    return leap

year = int(input())
print(is_leap(year))<jupyter_output><empty_output><jupyter_text>Print Function<jupyter_code>n = int(input())

for i in range(1, n + 1):
    print(i, end ="")<jupyter_output><empty_output><jupyter_text>List Comprehensions<jupyter_code>x = int(input())
y = int(input())
z = int(input())
n = int(input())

ar = []

for i in range(0, x + 1):           # three cycles to scroll the indexes from 0 to the input values
    for j in range(0, y + 1):
        for k in range(0, z + 1):
            if i+j+k != n:          # selection rule
                ar.append([i, j, k])
                
print(ar)<jupyter_output><empty_output><jupyter_text>Find the Runner-Up Score!<jupyter_code>n = int(input())
arr = map(int, input().split())

my_set = set(arr)                # eliminate the doubles
my_list = sorted(list(my_set))   # organize the element of the list

print(my_list[-2])               # the runner up score is the second to last element of the list<jupyter_output><empty_output><jupyter_text>Nested Lists<jupyter_code>if __name__ == '__main__':
    List = []
    scores = []
    n = int(input())
    
    for i in range(n):
        name = input()
        score = float(input())
        List.append([name, score])  # stored the neme of the studet with his/her score
        scores.append(score)        # stored ONLY the student score
        
    List.sort()                         # sort the couple name-score in alphabetic order
    scores = sorted(list(set(scores)))  # eliminate the doubles scores and sort it increasing order
    for i in range(n):
        if List[i][1] == scores[1]:     # if the students have the the second lowest grade, print his/her name
            print(List[i][0])<jupyter_output><empty_output><jupyter_text>Finding the percentage<jupyter_code>if __name__ == '__main__':
    n = int(input())
    student_marks = {}   # dictionary to store the name of student associated to a list of three items
    
    for _ in range(n):                  
        name, *line = input().split()
        scores = list(map(float, line))  # take the score
        student_marks[name] = scores     # fill the dictionary
    query_name = input()                 #asking the name of the student to evaluete
x = 0
for i in range(3):                       # computes the everage of the marks 
    x += student_marks[query_name][i]/3
print("%.2f" %x)                         # print the everege whit two decimals<jupyter_output><empty_output><jupyter_text>Lists<jupyter_code>N = int(input())
List = []

for i in range(N):
    line =input().split()     

    if line[0] == 'insert':
        List.insert(int(line[1]),int(line[2]))
    elif line[0] == 'print':
        print(List)
    elif line[0] == 'remove':
        List.remove(int(line[1]))
    elif line[0] == 'sort':
        List.sort()
    elif line[0] == 'append':
        List.append(int(line[1]))
    elif line[0] == 'pop':
        List.pop()
    elif line[0] == 'reverse':
        List.reverse()<jupyter_output><empty_output><jupyter_text>sWAP cASE<jupyter_code>def swap_case(s):
    return s.swapcase() # swape case the element of the string

if __name__ == '__main__':
    s = input()
    result = swap_case(s)  
    print(result)<jupyter_output><empty_output><jupyter_text>String Split and Join<jupyter_code>def split_and_join(line):
    line = line.split()     # split the sting every space and return a list
    return  '-'.join(line)  # join every element of the list with thw character '-'

if __name__ == '__main__':
    line = input()
    result = split_and_join(line)
    print(result)<jupyter_output><empty_output><jupyter_text>What's Your Name?<jupyter_code>def print_full_name(a, b):
    print("Hello ", a, " ", b,"! You just delved into python.", sep = "")

if __name__ == '__main__':
    first_name = input()
    last_name = input()
    print_full_name(first_name, last_name)<jupyter_output><empty_output><jupyter_text>Mutation<jupyter_code>def mutate_string(string, position, character):                  #chang character to a string and return the string 
    return string[:position] + character + string[position+1:] 

if __name__ == '__main__':
    s = input()
    i, c = input().split()
    s_new = mutate_string(s, int(i), c)
    print(s_new)<jupyter_output><empty_output><jupyter_text>Find a string<jupyter_code>def count_substring(string, sub_string):
    count = 0
    for i in range(1+len(string)-len(sub_string)):     # scroll the string in serch of the sub_string
        if string[i:i+len(sub_string)] == sub_string:  
            count += 1
    return count

if __name__ == '__main__':
    string = input().strip()
    sub_string = input().strip()
    
    count = count_substring(string, sub_string)
    print(count)<jupyter_output><empty_output><jupyter_text>String Validators<jupyter_code>if __name__ == '__main__':
    string = input()

    print(any(map(str.isalnum,string))) # map aplly the function to everi elementi of the string and return a list 
    print(any(map(str.isalpha,string))) # of TRUE and FALSE. if there's at least 1 TRUE the function any() return TRUE, 
    print(any(map(str.isdigit,string))) # else terurn FALSE
    print(any(map(str.islower,string)))
    print(any(map(str.isupper,string)))<jupyter_output><empty_output><jupyter_text>Text Alignment<jupyter_code>thickness = int(input()) #This must be an odd number
c = 'H'

#Top Cone
for i in range(thickness):
    print((c*i).rjust(thickness-1)+c+(c*i).ljust(thickness-1))

#Top Pillars
for i in range(thickness+1):
    print((c*thickness).center(thickness*2)+(c*thickness).center(thickness*6))
#Middle Belt
for i in range((thickness+1)//2):
    print((c*thickness*5).center(thickness*6))
#Bottom Pillars
for i in range(thickness+1):
    print((c*thickness).center(thickness*2)+(c*thickness).center(thickness*6)) 
#Bottom Cone    
for i in range(thickness):
    print(((c*(thickness-i-1)).rjust(thickness)+c+(c*(thickness-i-1)).ljust(thickness)).rjust(thickness*6))<jupyter_output><empty_output><jupyter_text>Text Wrap<jupyter_code>import textwrap

def wrap(string, max_width):
    return textwrap.fill(string, max_width)

if __name__ == '__main__':
    string, max_width = input(), int(input())
    result = wrap(string, max_width)
    print(result)<jupyter_output><empty_output><jupyter_text>Designer Door Mat<jupyter_code>row, col = map(int,input().split()) 

# Top pattern
for i in range((row-1)//2):
    print(('.|.'*i).rjust((col//2-1), '-')+'.|.'+('.|.'*i).ljust((col//2-1), '-'))
# Central 'WELCOM'    
print('WELCOME'.center((col),'-'))
# Bottom pattern
for i in range((row-1)//2):
    print(('.|.'*(row//2-i-1)).rjust((col//2-1), '-')+'.|.'+('.|.'*(row//2-i-1)).ljust((col//2-1), '-'))<jupyter_output><empty_output><jupyter_text>String Formatting<jupyter_code>def print_formatted(n):

    for i in range(1, n + 1):
        print(str(i).rjust(len(bin(n)[2:])), str(oct(i)[2:]).rjust(len(bin(n)[2:])), str(hex(i)[2:]).upper().rjust(len(bin(n)[2:])), str(bin(i)[2:]).rjust(len(bin(n)[2:])))



if __name__ == '__main__':
    n = int(input())
    print_formatted(n)<jupyter_output><empty_output><jupyter_text>Introduction to Sets<jupyter_code>def average(array):
    heights = list(set(array))     # delete copies
    sum = 0   
    for i in range(len(heights)):  # average calculation
        sum += heights[i]
    return (sum/len(heights))

if __name__ == '__main__':
    n = int(input())
    arr = list(map(int, input().split()))
    result = average(arr)
    print(result)<jupyter_output><empty_output><jupyter_text>Symmetric Difference<jupyter_code>M = int(input())
set_1 =set(map(int, input().split()))
N = int(input())
set_2 =set(map(int, input().split()))

# make a list with the elements of set_1 and set_2 that are not in the intersection
Diff = (set_1.union(set_2)).difference(set_1.intersection(set_2)) 

new_list = sorted(list(Diff)) # sort the element increasing order
list(map(print, new_list))    # print the items one at a time<jupyter_output><empty_output><jupyter_text>No Idea!<jupyter_code>N, M = map(int, input().split())
Array = list(map(int, input().split()))
A = set(map(int, input().split()))
B = set(map(int, input().split()))

count = 0

for i in range(len(Array)): # Counting the score
    if Array[i] in A:
        count += 1
    elif   Array[i] in B:
        count -= 1

print(count)<jupyter_output><empty_output><jupyter_text>Tuples<jupyter_code>n = int(input())
integer_list = tuple(map(int, input().split()))
print(hash(integer_list))<jupyter_output><empty_output><jupyter_text>Set .add()<jupyter_code>all_country = set([]) #initializing set
N = int(input())

for i in range(N):            #fill the set with elements
    all_country.add(input()) 

print(len(all_country))       # count the lenght of the set<jupyter_output><empty_output><jupyter_text>Set .discard(), .remove() & .pop()<jupyter_code>n = int(input())
s = set(map(int, input().split()))
N = int(input())

for i in range(N):
    line = input().split()
    if line[0] == 'pop':
        s.pop()
    elif line[0] == 'remove':
        s.remove(int(line[1]))
    elif line[0] == 'discard':
        s.discard(int(line[1]))

sum = 0

for i in range(len(s)):
    sum += list(s)[i]

print(sum)<jupyter_output><empty_output><jupyter_text>Set .union() Operation<jupyter_code>n = int(input())                           
newspaper_1 = set(map(int, input().split()))
m = int(input())                              
newspaper_2 = set(map(int, input().split()))

print(len(newspaper_1.union(newspaper_2)))   # union<jupyter_output><empty_output><jupyter_text>Set .intersection() Operation<jupyter_code>n = int(input())                           
newspaper_1 = set(map(int, input().split()))
m = int(input())                              
newspaper_2 = set(map(int, input().split()))

print(len(newspaper_1.intersection(newspaper_2)))   # intersection<jupyter_output><empty_output><jupyter_text>Set .difference() Operation<jupyter_code>n = int(input())                           
newspaper_1 = set(map(int, input().split()))
m = int(input())                              
newspaper_2 = set(map(int, input().split()))

print(len(newspaper_1.difference(newspaper_2)))  # difference<jupyter_output><empty_output><jupyter_text>Set .symmetric_difference() Operation<jupyter_code>n = int(input())                           
newspaper_1 = set(map(int, input().split()))
m = int(input())                              
newspaper_2 = set(map(int, input().split()))

print(len(newspaper_1.symmetric_difference(newspaper_2)))  # symmetric difference<jupyter_output><empty_output><jupyter_text>Set Mutations<jupyter_code>N = int(input())
L = set(map(int, input().split()))
m = int(input())

for i in range(m):
    line = input().split()
    if line[0] == 'intersection_update':
        l = set(map(int,input().split()))
        L.intersection_update(l)
    elif line[0] == 'symmetric_difference_update':
        l = set(map(int, input().split()))
        L.symmetric_difference_update(l)
    elif line[0] == 'difference_update':
        l = set(map(int, input().split()))
        L.difference_update(l)
    elif line[0] == 'update':
        l = set(map(int, input().split()))
        L.update(l)

sum = 0
R = list(L)
for i in range(len(R):
    sum += R[i]

print(sum)<jupyter_output><empty_output><jupyter_text>Check Subset<jupyter_code>N = int(input())

for i in range(N):                     
    nA = int(input())
    A = set(map(int,input().split()))
    nB = int(input())
    B = set(map(int,input().split()))

    print(A.issubset(B))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1612, 'fraction_numerical': 0.01024, 'mean_word_length': 3.6489401264410564, 'pattern_counts': {'":': 0, '<': 139, '<?xml version=': 0, '>': 137, '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': '34', 'dir': 'jupyter-structured-clean-dedup', 'id': '405627', 'license': 'MIT', 'n_tokens_mistral': 4564, 'n_tokens_neox': 4427, 'n_words': 920, 'path': 'HomeWork_1.ipynb', 'repo_name': 'MirkoLozzi/HomeWork_1', 'size': '12500'}