zoukankan      html  css  js  c++  java
  • python随心笔记

    1 print "hello,world"   #打印hello,world
    print “1+1”  #打印字符串 1+1 单引号和双引号是单行字符串
    print ["1+1" "+" "2+2" " " *2]*2
    print ('''This is the first line
            This is the second line
            lont line''')   #三引号是多行字符串,可以直接输入回车,而不需要用
    来表示
    print 1/2 #取整数型 输出0
    print 6/3 #取整数型 输出2
    print 1.0/2.0  #浮点型 输出0.5
    print 6.0/3.0 #浮点型 输出2.0
    print 6.0%3.0 # %求余运算符 
    
    a = 'tset'
    print 'it is a %s' %(a) #%还用在python的格式化输出,打印的结果就是 it is a test
    print 2 * 2 * 2 
    
    x = input ("x:")
    y = input ("y:")
    print x*y
    
    x1 = input("x1:")
    y1 = input("y1:")
    print x1 + y1
    
    print 2**3  #打印2的3次方
    print pow(2,3) #打印2的3次方
    print 10+pow(2,3*5)/3.0   #pow() 2的15次方 /3.0 +10
  • 相关阅读:
    jsp.图书馆
    jsp第七次作业
    jsp第六次作业
    jsp第四次作业
    JSP第二次作业
    软件测试课堂练习
    Android第六次作业
    Android第五次作业
    Android第四次作业
    Android第三次作业
  • 原文地址:https://www.cnblogs.com/wojiaoxuelei/p/5957367.html
Copyright © 2011-2022 走看看