题目
Exercise 10.1: Least squares
Generate matrix A 2 Rmn with m > n. Also generate some vector b 2 Rm.
Now nd x arg minx kAx �� bk2.
Print the norm of the residual.Exercise 10.2: Optimization
Find the maximum of the function
f(x…
1.除二取余法
整型变量num的值通过input函数动态输入,使用“除2取余”方法打印输出num是奇数还是偶数
num int(input("请输入一个整数:"))
if num % 2 1:print(f"{num}是一个奇数。")
else:print(f"{num}是一个偶数。")
控制台输…