没有合适的资源?快使用搜索试试~ 我知道了~
《Python少儿编程》同步训练答案.docx
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 170 浏览量
2022-12-17
14:47:38
上传
评论
收藏 97KB DOCX 举报
温馨提示
试读
26页
...
资源推荐
资源详情
资源评论
� 1 � �� Python ����
1����
�1�C �2�B �3�C �4�C �5�A
2����
�1�Python ��������������������������������
������
�2�Python ������� Web ������������������������
������
3����
�1�
print(' ���')
print(' ——��')
print('������')
print('������')
print('������')
print('������')
�2�
print('
i-i-i-i-i')
print(' *****************')
print(' | �H-a-p-p-y� |')
print('~~~~~~~~~~~~~~~~~~~~~~')
print('| �B-i-r-t-h-d-a-y� |')
print('**********************')
�3�
print(' * * * *')
print('*
print('*
print(' *
print('
**
*')
*')
*')
**')
� 2 � Python �������
1����
�1�B �2�B �3�A �4�A �5�D
2����
�1���������� ��
�2�9
�3�399.7
�4�False
�5�True False
3����
�1�
name = input('������')
age = int(input('������'))
address = input('������')
print(name, '��', age, '��', '���', address, '�')
�2�
price = float(input('��������'))
amount = int(input('��������'))
total_price = price * amount
print('������', total_price)
�3�
weight = float(input('�������(kg)�'))
height = float(input('�������(m)�'))
BMI = weight / (height * height)
print('�� BMI ���', BMI)
�4�
episode = �' ��������������������������������' \�
'�����������������������������������' �\
'���������������������������'�\
'��������������������' \
'���������������������������������' \��
'����������������������' \
'����������������������������'�
print('��' in episode)
print('���' in episode)
print('����' in episode)
� 3 � ��������
1����
�1�A �2�A �3�C �4�D �5�A
2����
�1�24
�2�20 10 10
�3�① a > b ② b = t
�4�15
3����
�1�
weight = float(input('����������'))
if weight < 0:
print('���������')
elif weight <= 20:
print('����������')
elif weight <= 30:
price = (weight - 20) * 5
print('�������', price, '��')
elif weight <= 40:
price = (30 - 20) * 5 + (weight - 30) * 10
print('�������', price, '��')
elif weight <= 50:
price = (30 - 20) * 5 + (40 - 30) * 10 + (weight - 40) * 15
print('�������', price, '��')
else:
print('��������������������')
�2�
for cock in range(0, 20 + 1):
for hen in range(0, 33+1):
#����� 0 � 20 ��
#����� 0 � 33 ��
#����� 3 � 99 ��
for biddy in range(3, 99 + 1):
if (5 * cock + 3 * hen + biddy / 3) == 100: #�������� 100
if (cock + hen + biddy) == 100:
if biddy % 3 == 0:
#����������� 100
#��������� 3 ��
print('��:', cock, '��:', hen, '��:', biddy) #��
�3�
i = 2
while i < 100:
j = 2
#����� 2�100
while j < i:
#����� 2�i
#�� i ��� j�i ����
#����
if i % j == 0:
break
j = j + 1
if j == i:
print(i)
i = i + 1
�4�
#��� 2�i ��������� j �� i��� i ���
#����
for i in range(1, 10):
for j in range(10 - i):
print(end=' ')
#����� 1�9
#����� 0�9-i
#���������
for k in range(10 - i, 10):#����� 10-i�9
print('*', end=' ') #���������
print('')
#��
� 4 � ���������
1����
�1�C �2�B �3�A �4�A �5�B �6�C
2����
�1�helloworld d llo hlod lrowolleh
�2�PYTHON STRING python string 10 Python Strgni
�3���� ���
�4�8
�5�{'name': None, 'age': None, 'weight': None, 'height': None}
�6�for value in num_dict.values():
3����
�1�
flag = True
#������������ True
checkStr = input('�����������')
low = 0
#��������
#��������
high = len(checkStr) - 1
while low < high:
#������������
if checkStr[low] != checkStr[high]:
flag = False
low += 1
high -= 1
if flag:
print('“{}”�����'.format(checkStr))
else:
print('“{}”������'.format(checkStr))
�2�
dictCourse = {'��': '���',
'��': '����',
'��': 'Python',
'��': '���',
'��': '��',
'���': 'Java'}
dictCourse['��'] = 'Java'
dictCourse['���'] = 'Python'
dictCourse.pop('��')
print('********������********')
for teacher, course in dictCourse.items():
print(teacher, course)
#���������� Java
#������� Python
#��������
print('******���� Python ���******')
for teacher, course in dictCourse.items():
if course == 'Python':
print(teacher, end=' ')
�3�
dict1 = {'��': [123456, 0], '��': [12345678, 0]} #������������
while True:
name = input('������:')
#����
#�����
password = int(input('�����:'))
if name not in dict1.keys():
print('�������')
continue
#����
#�������������
#�����
#������
#������ 2
if dict1[name][1] == 2:
print('3 ��������������') #���������
break
#����
if password == dict1[name][0]:
#���������
print('����')
#���������
#����
break
else:
#������
#�����
#��� 1
print('��������')
dict1[name][1] += 1
�4�
strs = input('���������')
setStrs = set(strs)
#�����
#������������
#��������
#��������
#����������
listStrs = list(setStrs)
listStrs.sort()
for x in listStrs:
print(x, end='')
� 5 � �������
1����
�1�C �2�C �3�A �4�D �5�B �6�D �7�C �8�A
2����
�1���
�2�return
�3����
�4���
�5���
�6�global
�7�7 5
�8�5 4
�9�1 3 4
�10�1
3����
�1�
def narcissistic(n):
b = int(n / 100)
#�����
s = int((n - 100 * b) / 10)
g = n % 10
#�����
#�����
if n == g ** 3 + s ** 3 + b ** 3:
return '{}�����'.format(n)
else:
#����������������
return '{}������'.format(n)
num = int(input('����� 3 ����'))
print(narcissistic(num))
�2�
def hano(n, x, y, z):
if n == 1:
#n �����x ������y ������z �����
print(x, '->', z)
else:
剩余25页未读,继续阅读
资源评论
- maxmac6666662023-12-04非常有用的资源,有一定的参考价值,受益匪浅,值得下载。
G11176593
- 粉丝: 6643
- 资源: 3万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功