Introduction to Python project development and Advanced (3rd day) __python

Source: Internet
Author: User

1. Szinput = input ("<<<") #只能输入字符串

2. ninput = Int (szinput) #字符串转换成数字3. While else
Continue #终止当前循环
Break #终止循环
4. and #条件与
5. Pycharm Installation and Setup
Font: 28 line number Mouse changes font size: Mouse->editor->general->change font size (Zoom) with ctrl+mouse Wheel Template: Editor->code styl E->file and Code Templates->file->python script

#coding =utf-8
#Version:p ython3.6.0
#Tools:P ycharm 2017.3.2
_date_ = ' $DATE $TIME '
_author_= ' Mafucun '
6. Substring
#子序列, substring
SzName = "Mafucun"
If "Ma" in SzName:
    print (' OK ')
else:
    print (' Error ')
7. Ctrl +? #快速注释语句
8. In/not in# Determines whether a member operates in a string
9. Boolean value True, False
10. Comparison operators: = = =, ",", >=, <=,!=, <>
It is recommended to use parentheses True or ==>true False and ==>false other needs to continue to judge 11. Basic Data type characteristics
number int string str list Group tuple dictionary Dict boolean value bool 12. CTRL + Left key, data type characteristics
13. Digital
Int () #将字符串转换为数字

Type () #显示变量类型

num = 123
v = num.bit_length ()
print (v)
14. String
Name = "Shizhengwen"
v1 = name.upper ()
print (v1)
szstring = "123"
print (Type (szstring), szstring)
szString2 = "0b11" #二进制
szString3 = "0011" #二进制
nint = Int (szString3, base = 2) #将2进制的数值转换为10进制
nage = 10
  nlength = Nage.bit_length () #数值的二进制位数
print (nlength)

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.