python趣味代码(拜托了看看吧)

 2023-09-18 阅读 30 评论 0

摘要:我发现我最近掉粉了,这才发觉:完了完了,我忘了我已经这么多天没有更新,我的情绪也慢慢的慌起来了,心想:嗯不能再拖更了。然后马上上电脑打上3组趣味代码 python的有趣代码、 import time words = input('Please input the words y

我发现我最近掉粉了,这才发觉:完了完了,我忘了我已经这么多天没有更新,我的情绪也慢慢的慌起来了,心想:嗯不能再拖更了。然后马上上电脑打上3组趣味代码

python的有趣代码、

import time
words = input('Please input the words you want to say!:')
for item in words.split():print('\n'.join([''.join([(item[(x-y) % len(item)] if ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3 <= 0 else ' ') for x in range(-30, 30)]) for y in range(12, -12, -1)]))time.sleep(1.5)

这个是爱心的,只需要填入1个或者几个数字就会出现一个爱心

python编程100例、------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

print('\n'.join([' '.join(['%s*%s=%-2s' % (y, x, x*y) for y in range(1, x+1)]) for x in range(1, 10)]))

这个是九九乘法表😁😁😁

 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

# coding=utf-8
import random
# 获胜次数
win_times = 0
while win_times <= 2:player = input('请输入:剪刀(0)  石头(1)  布(2):')player = int(player)computer = random.randint(0,2)if ((player == 0) and (computer == 2)) or ((player ==1) and (computer == 0)) or ((player == 2) and (computer == 1)):win_times += 1print('获胜,哈哈,你太厉害了')elif player == computer:print('平局,要不再来一局')else:print('输了,不要走,洗洗手接着来,决战到天亮')

这个是剪刀石头布不的代码😁😁😁😁

python浪漫代码? -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

给个三连吧,各位大大😭😭

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://808629.com/79943.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 86后生记录生活 Inc. 保留所有权利。

底部版权信息