码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
Linux下Python学习笔记 2:条件判断、循环
一、条件判断if 语句比如,输入用户年龄,根据年龄打印不同的内容,在Python程序中,可以用if语句实现:注意: Python代码的缩进规则。具有相同缩进的代码被视为代码块,上面的3行 print 语句就构成一个代码块(但不包括第4行的print)。如果 if 语句判断为 True,就会执行这个代...
分类:编程语言   时间:2015-09-14 00:32:35    阅读次数:296
Java记录 -28- String Literals字面值
StringLiterals(Java语言规范JavaLanguageSpecifications)Theprogramconsistingofthecompilationunit:packagetestPackage;classTest{publicstaticvoidmain(String[]args){Stringhello="Hello",lo="lo";System.out.print((hello=="Hello")+"");System.out.print((Other.hello=..
分类:编程语言   时间:2015-09-13 20:04:56    阅读次数:148
一道C的题
这道题是这样的 1 #include 2 void print() 3 { 4 //只可以在这里写代码, 5 //输出arr数组中的所有内容 6 } 7 int main() 8 { 9 int a = 1;10 int b = 2;11 char c = ...
分类:其他好文   时间:2015-09-13 18:38:14    阅读次数:108
Head First Python 第一章 初始Python
1.安装python解释器和ide,这里选择pycharm,配好环境2.列表的例子: python没有数组,只有元组合列表 列表例子如下movies=["titanic","the big bang theory"]print (movies[0]) 列表支持insert,pop,remove...
分类:编程语言   时间:2015-09-13 13:18:56    阅读次数:187
设计模式之静态工厂模式
public interface Printer { public abstract void open(); public abstract void close(); public abstract void print();}public class HPPrinter imple...
分类:其他好文   时间:2015-09-13 13:14:38    阅读次数:115
3.2.5.8 原始字符串的使用方法
在正则表达式里,经常要使用斜线(\)来指明一个集合,但是斜线(\)也是字符串里转义字符的特定标志,为了编写正则表达式更简单,可以使用原始字符串的方式,也就是在字符串前面添加小写字母r来指明。下面这个例子使用到两个正则表达式语句是等价的。例子:print(r'text')print( re.match(r"\W(.)\1\W", " ff "))print( re.match("\\W(.)\\1\...
分类:其他好文   时间:2015-09-13 09:23:35    阅读次数:158
3.2.5.9 写一个词法分析器
词法分析器或者叫扫描器主要用来分析字符串的文本,然后把文本里组成的单词分析出来,识别为某一类型的属性。对于编写编译器或者解析器的第一步工作就是做这样的事情:词法分析。以前有很多种使用字符串搜索的办法,这里使用正则表达式来实现这个目的。例子:print("词法分析器") import collections import re Token = collections.namedtuple('To...
分类:其他好文   时间:2015-09-13 09:22:43    阅读次数:140
Shell Commands
Most commands operate like this: command -options argumentspwd(print working directory)cd(change directory). Absolute pathname: "cd /home/students...
分类:系统相关   时间:2015-09-13 09:19:09    阅读次数:224
那些年遇到的php之坑
1. php指针没有重置$arr = array( array('aaaaaaaa'), array('bbbbbbb'));unset($arr[0]);unset($arr[1]);sort($arr);$arr[] = array('cccccccccc');print_r(arr...
分类:Web程序   时间:2015-09-13 07:04:57    阅读次数:143
yxcms如何在本栏目调用本栏目名称的方法
可以这样调用 {$sorts[$id][‘name‘]}? 或在模板中直接这样调用 <?php?print_r($sorts["$id"][‘name‘])?> 如果要在内容页调用所属栏目名.可以这样,即先统计数组数量,再取最后一个数组对应的值 <?php?print_r($...
分类:其他好文   时间:2015-09-12 17:48:24    阅读次数:126
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!