zoukankan      html  css  js  c++  java
  • day1学python Hello Python

    Hello Python

    本人使用的是Pycharm编译器

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

    1.输出

    2.赋值

    3.‘’‘/“”“ 多行注释

    4.if-elif-else语句

    5.  while :  while和else联合判断! 若while后全部执行完执行else 后语句 见下方代码@@处!!!

    6.for语句 for i in range(10): 与c++和java不同 需要注意!

    7.在if/for等函数后 切记加:!!

    8.table格式要注意!只有上下位置对应时 表示同级概念     与c++和java不同 需要注意!

    ==============================================================

    Hello World

    # print("hello world")
    # name="2na "
    # '''
    # sda
    # '''
    # usename=input("name:")
    #
    # if(name==usename):
    #     print("welcome {}! ". format(usename))
    # else:
    #     print("{} is wrong ". format(usename))
    # print("over")

    ==============================================================
    循环与条件语句示例

    age=56
    count=0
    while(count<3):
        count=count+1
        if(age==int(input("age:"))):
            print("输入正确")
            break
        else:
            print("输入错误,请重新输入(已输入{}次)".format(count))
        if(count==3):
             confirm=input("do you want to contiue??")
             if(confirm!='n'):
                count=0
    
     else:
         print("输入错误次数超过三次!强制退出")
    for i in range(3):

        if(age==int(input("age:"))):
             print("输入正确")
             break
        else:
             print("输入错误,请重新输入(已输入{}次)".format(i+1))
        if(i==2):
    confirm=input("do you want to contiue??")
            if(confirm=='y'):
               i=0









  • 相关阅读:
    axios的封装
    单行和多行文本溢出省略号显示!!!
    vue2源码-响应式处理(学习笔记)-2
    vue2源码-rollup的配置(学习笔记)-1
    js的垃圾回收机制
    立即执行函数
    闭包笔记
    vue3.0的CompositionAPI
    Create gym environment with your own xml file and training it using her of baseline
    Brief introduction to mujoco or gym modeling using xml
  • 原文地址:https://www.cnblogs.com/cc123nice/p/10447780.html
Copyright © 2011-2022 走看看