美文网首页
笨办法学python3_ex.6

笨办法学python3_ex.6

作者: leogoforit | 来源:发表于2020-03-07 10:58 被阅读0次

    第6个练习继续熟悉字符串的用法。在编辑器中输入如下代码:

    types_of_people =10
    x = f"There are {types_of_people} types of people"
    
    binary = "binary"
    do_not = "don't"
    y=f"Those who know {binary} and those who {do_not}."
    
    print(x)
    print(y)
    
    print(f"I said: {x}")
    print(f"I also said: '{y}'")
    
    hilarious = False
    joke_evaluation = "Isn't that joke so funny?!{}"
    
    print(joke_evaluation.format(hilarious))
    
    w="This is the left side of……"
    e="a string with a right side."
    
    print(w+e)
    
    运行结果

    相关文章

      网友评论

          本文标题:笨办法学python3_ex.6

          本文链接:https://www.haomeiwen.com/subject/zrjqdhtx.html