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:

  • 相关阅读:
    [POI2014]FarmCraft
    [POI2014]Solar Panels
    Luogu P2824 [HEOI2016/TJOI2016]排序
    CF903G Yet Another Maxflow Problem
    CF901C Bipartite Segments
    CF749E Inversions After Shuffle
    ARC068C Snuke Line
    BZOJ3747 [POI2015]Kinoman
    SA-IS
    简单字符串
  • 原文地址:https://www.cnblogs.com/acm-icpcer/p/11272514.html
Copyright © 2011-2022 走看看