代码开发环境:Eclipse 1.打印字符串: print "Hello world!" myString = "Hello world!" print myString 运行结果: Hello world! Hello world! 2.格式化字符串 print "%s is in the left of railway station %d" % ("huizhi", 2) 运行结果: huizhi is in the l…
用户输入: 例1.写一个用户输入密码的小程序,流程如下: 1.用户输入自己的用户名 2.打印"Hello+用户名" #!/usr/bin/env python #name = raw_input("What is your name?") #only on python 2.x name = input("What is your name?") print("Hello " + name ) 例2.输入密码时,我们都不希望自…