<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[jwsgd的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/jwsgd</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; jwsgd]]></copyright><item><title><![CDATA[Python练习商品加入购物车打印价格]]></title><link>https://blog.youkuaiyun.com/jwsgd/article/details/110187335</link><guid>https://blog.youkuaiyun.com/jwsgd/article/details/110187335</guid><author>jwsgd</author><pubDate>Thu, 26 Nov 2020 14:44:23 +0800</pubDate><description><![CDATA[python练习题，给大家提供思路而已，仅供参考
# -*- Codeing = utf-8 -*-
# @Time : 2020/11/23 16:10
# @Author : silence
# @File :deme5.py
# @Software ：PyCharm

products = [["iphone","6888"],["MacPro","14800"],["小米6","2499"],["Coffee","31"],["Book","60"],["Nike","699"]]
print("-]]></description><category></category></item><item><title><![CDATA[利用Python的for循环和while循环打印九九乘法表]]></title><link>https://blog.youkuaiyun.com/jwsgd/article/details/109828036</link><guid>https://blog.youkuaiyun.com/jwsgd/article/details/109828036</guid><author>jwsgd</author><pubDate>Fri, 20 Nov 2020 13:22:23 +0800</pubDate><description><![CDATA[#指定a为行，b为列
a = 1
while a &lt;=9:   #一共是9行，设置成9
    b = 1      #默认设置列数起始值是1,毕竟是在 第a行的基础上从第一列(即第一个)开始
    while b&lt;=a:#列小于行，就是在第几行里打印几个，因为每行等式个数和行数相等，所以，行数a就可以看成a行有a个等式
        print("{}*{}={}".format(b, a, a * b), end="\t")#列数开头美观放前面，打印列数乘行数和乘积，结束时留一个制表符位]]></description><category></category></item><item><title><![CDATA[Python练习题剪刀石头布]]></title><link>https://blog.youkuaiyun.com/jwsgd/article/details/109820287</link><guid>https://blog.youkuaiyun.com/jwsgd/article/details/109820287</guid><author>jwsgd</author><pubDate>Thu, 19 Nov 2020 18:08:44 +0800</pubDate><description><![CDATA[Python剪刀石头布，写法多种多样，本例只是结合书本当时所学知识和具体题目要求写的，并非最优解法，仅供初学者开拓思路而已，仅供参考，希望大家能多多思考其他方法。
from random import *#引入随机库
try:       #try-except异常处理
    gesture = ["剪刀","石头","布"]
    user = int(input("请输入剪刀(0),石头(1),布（2）："))
    computer = randint(0, 2)
    if user in ]]></description><category></category></item><item><title><![CDATA[python重复元素判定，编写一个函数，接受列表作为参数，如果一个元素在列表中出现不止一次，则返回True，但不要改变原来列表的值。同时编写调用这个函数和测试结果的程序]]></title><link>https://blog.youkuaiyun.com/jwsgd/article/details/98315216</link><guid>https://blog.youkuaiyun.com/jwsgd/article/details/98315216</guid><author>jwsgd</author><pubDate>Sat, 03 Aug 2019 11:12:18 +0800</pubDate><description><![CDATA[def Lbpd(a):    #定义函数Lbpd(a)
            a =a.split(" ")     #对参数a按照空格进行分词        
            if len(a)==len(set(a)):     #利用集合的不重复性，比较列表a和集合a的长度
                return "False,这是非重复序列"       #如相同则返回非...]]></description><category></category></item><item><title><![CDATA[随机密码生成。编写程序，在26个字母大小写和9个数字组成的列表中随机生成10个8位密码。]]></title><link>https://blog.youkuaiyun.com/jwsgd/article/details/98191210</link><guid>https://blog.youkuaiyun.com/jwsgd/article/details/98191210</guid><author>jwsgd</author><pubDate>Fri, 02 Aug 2019 12:51:28 +0800</pubDate><description><![CDATA[#e6.1随机密码生成，在26个字母大小写和9个数字组成的列表中随机生成10个8位密码
import random
s = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",
     "A","B","C","D","E","F","G"...]]></description><category></category></item><item><title><![CDATA[实现isPrime()函数，参数为整数，要有异常处理。如果整数是质数，返回True，否则返回False]]></title><link>https://blog.youkuaiyun.com/jwsgd/article/details/93082334</link><guid>https://blog.youkuaiyun.com/jwsgd/article/details/93082334</guid><author>jwsgd</author><pubDate>Thu, 20 Jun 2019 18:05:21 +0800</pubDate><description><![CDATA[#e5.5实现isPrime()函数
from math import sqrt
def isPrime(n):
        if n == 1:
            return False
        for i in range(2,int(sqrt(n))+1):    #在一般领域，对正整数n，如果用2到根号n之间的所有整数去除，均无法整除，则n为质数。
          ...]]></description><category></category></item><item><title><![CDATA[程序练习题3.5输出了一个简单的田字格，用函数简化其代码，输出更大的田字格。]]></title><link>https://blog.youkuaiyun.com/jwsgd/article/details/92841409</link><guid>https://blog.youkuaiyun.com/jwsgd/article/details/92841409</guid><author>jwsgd</author><pubDate>Wed, 19 Jun 2019 19:09:08 +0800</pubDate><description><![CDATA[#e5.1函数化输出田字格
def tianzige(h,l):
    a,b,c,d = "＋","－","丨","  "
    hang = 4*b + a
    ch   = 4*d + c
    for i in range(h):
        print(a+hang*l)
        print(c + ch*l)
        print(c + ch*l)
   ...]]></description><category></category></item></channel></rss>