Objective
In the previous section, we briefly describe how to develop Hello World in VS2013, and build an environment http://www.cnblogs.com/aehyok/p/3986168.html in VS2013. This section is primarily about learning the basics of Python.
Getting Started with Python basics
1. Print a string Hello world.
Print ('HelloWorld')
2. Print a path
Print ('C:\aehyok\aehyok')
It can be found that \a has escaped. If you do not want to escape, simply add an R to the string before
Print (R'C:\aehyok\aehyok')
3. String concatenation and string repetition times
Print ('str'+'ing','aehyok '*3)
4, the string two index way, from left to right index starting from 0, right-to-left index starting from 1.
word='aehyok'print (word[0],word[5]) print (word[- 1],word[-5])
5, the string is sliced: separated by a colon two index, the form of the variable [head subscript: Tail subscript]. The range of interception is before and after closing.
cat='aehyok'print (cat[3:]) print (cat[3:6 ]) print (cat[:-1]) print (cat[-1])
6. Get typed string and print string and string length and type
Object = input (") print ("Get Anlu integeris") ,object, type (object), Len (object))
VS2013 Learning notes in Python [Basic primer]