zoukankan      html  css  js  c++  java
  • 【python学习】字符串相关

    # -*- coding: utf-8 -*-
    # =============================================================================
    # Ctrl + 1: 注释/反注释
    # 
    # Ctrl + 4/5: 块注释/块反注释
    # 
    # Ctrl + L: 跳转到行号
    # 
    # Tab/Shift + Tab: 代码缩进/反缩进
    # =============================================================================
    
    for i in range(128):
        print(chr(i).__repr__(),end=" ")
    
    print(type('a'))
    
    print("I'm the bone of my sword.
    Steel is my body and ...")
    
    print("chrom	start	end	strand	name	score")
    print("chr1	520000	530000	+	gene1	0")
    print("\")
    
    chr_, start, end = "chr1", 1000, 2000
    tmpl = "gene1
    chromosome	{}
    start	{}
    end	{}"
    # 这里定义了一个 模板,{} 占位处在 format 时会被替换
    print(tmpl.format(chr_, start, end))
    
    bs = b"this is a bytes"
    print(type(bs))
    print(bs)
    
    #s = "hello world"
    #print(s)
    #s.encode('utf-8').decode('utf-16')
    #print(s)
    
    l1 = [1, "this is a str", 1.114, True]
    print(l1[1:3])

    result:

  • 相关阅读:
    ryzen nvidia hackintosh
    mysql count 主键之坑
    git命令
    MYSQL 注释
    yaf twig配置
    1.YAF 的安装
    yaf nginx 设置
    ubuntu 16 阿里云 vsftpd
    win10下 homestead 安装
    活动调度
  • 原文地址:https://www.cnblogs.com/acm-icpcer/p/11272514.html
Copyright © 2011-2022 走看看