zoukankan      html  css  js  c++  java
  • Python基本语句

    x = 1
    y = 1
    
    dataf = 1.0
    
    def fun1():
        print("fun1")
        
        
    class ClassB():
        def __init__(self):
            print("i am Class B")
            
        def ClassBFun1(self):
            print("i am class B fun1")    
        
    class ClassA(ClassB):
        def __init__(self):
            print("i am ClassA")
            
        def ClassAFun1(self):
            print("I am ClassAfun1")
        
    
    
    if __name__ == '__main__':
    
        print("main")
        
        #print("%d", x)
        
        print("His name is %s"%("wangtao"))
        print("He is %d years old"%(25))
        print("His height is %.2f"%(1.83))
        print("His height is %f"%(1.83))
        
        print("Name:%10s Age:%8d Height:%8.2f"%("wang", 25, 1.83))
        
        print("Name:%-10s Age:%08d Height:%08.2f"%("wang", 25, 1.83))
        
        #dataf = format(0.0015, '.2e')
        
        #print("%f"%(dataf))
        #print("His height is %.2f"%(dataf))
        
        
        
        fun1();
        
        classAa = ClassA();
        
        classAa.ClassAFun1();
        
        classAa.ClassBFun1();
        
        for i in range(100):
            print(i)
            
    

      

  • 相关阅读:
    BZOJ3000 斯特林公式
    组合数学一些结论
    CSP2019-JS 游记(总结)
    Atcoder AGC1~10 problem list
    ioi2015hw
    NOI2017解题报告
    HNOI2021游记
    4月做题记录
    WC2021题解
    P4592 [TJOI2018]异或
  • 原文地址:https://www.cnblogs.com/tao560532/p/5372096.html
Copyright © 2011-2022 走看看