#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct  8 13:55:56 2024

@author: sam
"""

from scipy import sparse as sp



'''a)'''

A = sp.diags([1,2,3,4,5],dtype=int) # 5x5 matrix A with integers 1,...,5 on the main diagonal

print(A.A) # prints matrix A in dense format
print()



'''b)'''

B = sp.diags([[1,2,3,4,5],[1,1,1,1]],[0,1],dtype=int) # like matrix A but with 4 1's on the diagonal directly above

print(B.A) # prints matrix B in dense format