码迷,mamicode.com
首页 > 编程语言 > 详细

python字符串

时间:2018-11-14 18:53:15      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:word   welcome   print   format   odi   tin   pytho   username   password   

python字符串连接

方法一:

info = ‘‘‘

--------------info of %s -----------------

name:%s

age:%s

‘‘‘%s(name,age)

方法二:

# -*- coding:utf-8 -*-

_username="Bill"
_password="111111"
username=input("username:")
password=input("password:")
if _username == username and _password == password:
print("Welcome user {name} login...".format(name=username))
else:
print("Invalid username or password!")

print("OK!")

 

 

系统默认输入的字符为字符串格式

 

循环:

break,跳出整个循环;

continue,跳出本次循环,进行下次循环。

 

注释:

当行注视:# 被注释内容

多行注释:""" 被注释内容 """

python字符串

标签:word   welcome   print   format   odi   tin   pytho   username   password   

原文地址:https://www.cnblogs.com/libin06/p/9959231.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!