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









  • 相关阅读:
    第 3 表格和按钮
    jQuery在线手册
    阮一峰:jQuery的几篇文章
    阮一峰:MVC、MVP和MVVM的图示
    javascript event(事件对象)详解
    图片加 alt 属性
    w3c School
    命名规范
    CSS和JS标签style属性对照表
    css 选择器
  • 原文地址:https://www.cnblogs.com/cc123nice/p/10447780.html
Copyright © 2011-2022 走看看