Python First order 2

Source: Internet
Author: User

Chapter Highlights:1: Use input () to get the Inputs. Print Output. Eval () converts a string to a data type2: identifieris the name of the element used by the programnaming principles: numbers, english, underline, kanji. The identifier cannot be a Keyword. 3: Keywordsrefers to the system has a function name, used by the system4: variables are used to store data in the program5:python has two types of numeric values: int and float6: when both integers and floating-point expressions are present, the system is automatically converted to floatUse int (value) to convert it to float type7: system analysis refers to analyzing data flow and determining the input and output of the system8: System design is the process by which programmers begin to design input and finally get output9: single row, multi-line conversionsingle line-"multiple lines:" \ "num=1+2+3+\4+5+6+\8+9Print (num)multiple Lines-"single line"; "Import OSos.system ("calc"); Os.system ("tasklist")Os.system ("ping Www.baidu.com")10: operators and Precedenceindex (* *) = "multiplication (*), Division rounding (//), Division (/), remainder (%) =" plus (+), minus (-)11: Roundinground ()date=3.5Print (date)12: time function Time.time ()Import timefnowtime=time.time ()**13 Key Programming TopicsTime zone Issues:Import time
gmt=EvalInput "please enter gmt:"))
Fnowtime=time.time ()
Fsecond=int (fnowtime)     #现在时间取整 fnowsecond=fsecond % 60    #余下的秒数 fminutes=fsecond // 60      #总的分钟 fnowminutes=fminutes % 60     < Span style= "color: #808080; Font-style:italic "> #余下的分钟数 fhours=fminutes//60      #总的小时 fnowhours=fhours%24    #余下的小时 fnowhours= (fnowhours+gmt)% Print (fnowsecond,fnowminutes,fnowhours)

Python First order 2

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.