VS2013 Learning notes in Python [Basic primer]

Source: Internet
Author: User

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]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.