zoukankan      html  css  js  c++  java
  • 第三天习题

    # count = 0
    # for i in range(1, 9):
    #     for v in range(1, 9):
    #         if i != v:
    #             count += 1
    # print(count)
    #####print('',sep=,end=) sep 分割符
    # 九九乘法表
    # 法1
    # for i in range(1, 10):
    #     s = ''
    #     for v in range(1, i + 1):
    #         c = i * v
    #         s += str(i) + str('*') + str(v) + str('=') + str(c) + '	'
    #     print(s)
    # 法2
    # for i in range(1, 10):
    #     for v in range(1, i + 1):
    #         c = i * v
    #         print(i,'*',v,'=',c,end='	')
    #     print('
    ',end='')
    
    
    # li = [1, 3, 4, 2, 5, 6]
    # for i in li:
    #     for v in li:
    #         if i != v:
    #             c = str(i) + str(v)
    #             print(c)
    
    # 一键买鸡
    # for b in range(1,100//5):  # 条件能减少循环的次数
    #     for c in range(1,100//3):
    #         for d in range(1,100):
    #             if 5*b + 3*c+1/3*d ==100 and b + c + d==100:
    #                 print(b, c, d)
    
    # 下划线拼接元素
    # li = ['dfas','rew',12321,4324]
    # string = ''
    # for i in range(0,len(li)):
    #     li[i] =str(li[i])
    # li1 = '_'.join(li)
    # print(li1)
    
    #打印和为9
    # nums = [2,3,5,4,7,3,1,8]
    # a = []
    # for i in nums:
    #     for v in nums:
    #         if i + v ==9:
    #             a.append((i,v))
    # print(a)###重复问题如何解决
    
    #for循环显示301条数据
    user_list = []
    for i in range(1,302):
        s = 'alex-{}    alex{}@live.com     pwd{}'
        v = s.format(i,i,i)
        user_list.append(v)
    page = input('请输入页码:')
    page1 = int(page)
    s1 = user_list[page1-1:10*page1]
    print(s1)
  • 相关阅读:
    实验四 Android开发基础
    20135322实验五实验报告
    Eclipse中Ant的配置与测试
    实验三 敏捷开发与XP实践
    实验二 Java面向对象程序设计
    Java实验报告一:Java开发环境的熟悉
    简单四则运算
    个人介绍
    团队冲刺第一阶段个人工作总结2
    团队冲刺第一阶段个人工作总结1
  • 原文地址:https://www.cnblogs.com/zy0718/p/8440963.html
Copyright © 2011-2022 走看看