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