print(a, b, c)
# 判断输入的数是否为素数
from math import sqrt
boolean = True
num = int(input('请输入数字:'))
#if num <= 2:
# pass
#else:
for x in range(2, int(sqrt(num))):# num
# 范围可以是num开根,前一半没有因子,后一半就没有因子
if num % x == 0:
boolean = False
break
#if (x + 1) == num:
# boolean = True
if not boolean:
print('%d 不是素数' % num)
else:
print('%d 是一个素数' % num)
# 画图形
row = int(input('请输入行数:'))
"""
for y in range(1, row + 1):
print('*' * y)
for x in range(1, row + 1):
for rank in range(1, x + 1):
print(rank, end = '')
print()
"""
# chr是将数字转换成ASCII码,ord是将ASCII码转换成数字
# 大写字母从65开始,小写字母从97开始
for z in range(1, row + 1):
for rank in range(65, 65 + z):
print(chr(rank), end = '')
print()
# 2到100内的素数打印出来
from math import sqrt
def search_prime(num):
is_correct = True
for factor in range(2, int(sqrt(num))):
if num % factor == 0:
is_correct = False
break
if not is_correct:
pass
#print('%d 不是一个素数' % num)
else:
print(num, end = '\t')
#print('%d 是一个素数' % num)
for x in range(2, 101):
search_prime(x)