B. Train Seats Reservation You are given a list of train stations, say from the station 1 to the station 100. The passengers can order several tickets from one station to another before the train leaves the station one. We will issue one train from t…
今天写代码时,需要统一化输出格式进行,一时想不起具体细节,用了最笨的方法,现在讲常见的方法进行一个总结. 一.格式化输出 1.整数的输出 直接使用'%d'代替可输入十进制数字: >>> print 'i am %d years old'%25 i am 25 years old %x —— hex 十六进制 %d —— dec 十进制 %o —— oct 八进制 >>> num=10 >>> print'dec=%d, oct=%o, hex=%x'%…