zoukankan      html  css  js  c++  java
  • Day 13 Python 一之helloworld

    直接肝程序吧!

    """
    # 作业六:用户登录测试(三次机会)
    
    count = 1
    while count <= 3:
        user = input('请输入用户名: ')
        password = input ('请输入密码: ')
        if user == 'dachao' and password == '123':
            print ('你真厉害!!!')
            break
        else:
            print ('再试一次呦!')
            count+=1
    """
    
    
    
    """
    # 作业四:输出1-100内所有的偶数
    
    i = 1
    while i <= 100:
        if i%2 == 0:
            print (i)
        i+=1
    """
    """
    # 作业三:输出1-100内的所有奇数
    
    i = 1
    while i <= 100:
        if i%2 != 0:
            print (i)
        i+=1
    """
    
    """
    # 作业二:求1-100的所有数的和
    
    i = 1
    sum = 0
    while i <= 100:
        sum = sum + i
        i+=1
    print (sum)
    
    """
    
    """
    # 作业一:while 循环输出1 2 3 4 5 6  8 9 10 无7 !!!
    
    i = 1
    while i <= 10:
        if i !=7:
            print (i)
      #      i+=1
      #  else:
      #      i+=1
      #      continue
        i+=1
    """
    
    
    
    """
    name = input ('请输入用户名: ')
    password = input ('请输入密码: ')
    
    if name == 'dachao' and password == '123':
        print ('user login successful')
    else:
        print ('user or code is wrong!')
    
    """
    """
    #通过tag的True赋值,实现用户名和密码必须为真进行下一步,否则无线循环的目的。
    tag = True
    while tag :
        username = input ('input username: ')
        password = input ('input password: ')
        if username == 'dachao' and password == '123' :
            while tag :
                cmd = input ('>>: ')
                if cmd == 'q' :
                    tag = False
                    continue
                print ('------->%s' %cmd)
    
    """
    """
    #九九乘法表
    for i in range(1,10) :
        for j in range(1,i+1) :
            print ('%d*%d=%d' %(i,j,i*j),end = ' ')
        print ()    #每次执行语句自动占用一行,“/n”代表空一行
    """
    
    """
    name = input ('请输入用户名: ')
    
    if name == 'dachao' :
        print ('你最牛逼!')
    elif name == 'xiaochao' :
        print ('你可以的!')
    else:
        print ('你还需努力呢!')
    
    """
    
    """
    while True:
        print ('123')
        print ("456")
        continue
        
    """
    """
    import getpass
    password = getpass.getpass ('请输入密码: ')
    print (password)
    #自带idle不支持隐藏回显。
    
    """
    Python入门
  • 相关阅读:
    B站14天数据分析笔记6次课笔记
    B站14天数据分析笔记5次课作业
    B站14天数据分析笔记5次课Pandas
    1037 在霍格沃茨找零钱 (20 point(s))
    第一章:第三节探索性数据分析
    Java没有运行选项
    Eclipse截图的时候错误提示消失/复制粘贴错误信息
    错误记录_css属性的值一定不需要引号么?
    错误记录_语法哪里错了?
    微软输入法使用
  • 原文地址:https://www.cnblogs.com/LiChaoAI/p/6952643.html
Copyright © 2011-2022 走看看