码迷,mamicode.com
首页 >  
搜索关键字:elif    ( 966个结果
Holes in the text Add problem to Todo list Problem code: HOLES
1 import sys 2 3 4 def count_holes(letter): 5 hole_2 = ['A', 'D', 'O', 'P', 'Q', 'R'] 6 if letter == 'B': 7 return 2 8 elif let...
分类:其他好文   时间:2015-05-05 18:32:35    阅读次数:125
VC Preprocessor definitions
在项目上点击右键->setting->C/C++->Preprocessor definitions 在里面加入自定义预编译头_SB2 测试代码: include “stdafx.h”include include ifdef _SBprintf("调用了sb\n"); elif _SB2printf("调用了sb2\n"); elseprintf("Hello World!\n"); endifr...
分类:其他好文   时间:2015-05-05 12:35:56    阅读次数:94
shell脚本练习002
1、不想说了、有机会在写#!/bin/bash cd/root/test fornamein`ls` do if[-d$name] then mv/root/test/$name/*.mp4/root/test/key_$name.mp4 mv/root/test/$name/my elif[[${name:0:4}-ne‘key_‘]] then mv$namekey_$name else echo$name>1.log fi done
分类:系统相关   时间:2015-05-04 20:24:44    阅读次数:141
python关键字
python有多少关键字?>>> import keyword>>> keyword.kwlist['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec',...
分类:编程语言   时间:2015-05-04 11:38:53    阅读次数:158
python 5 条件判断和循环
#!/usr/bin/env python # -*- coding: utf-8 -*- age = 3 if age >= 18: print 'adult' elif age >= 6: print 'teenager' else: print 'kid' print '----------------------' names = ['jie', 'bob', 'trcy'] f...
分类:编程语言   时间:2015-05-02 01:07:38    阅读次数:171
shell流程控制语句 if while for case
linux shell有一套自己的流程控制语句,其中包括条件语句(if),循环语句(for,while),选择语句(case)。下面我将通过例子介绍下,各个语句使用方法。一、shell条件语句(if用法)if语句结构[if/then/elif/else/fi]if 条件测试语句 thenaction...
分类:系统相关   时间:2015-04-27 11:08:42    阅读次数:208
17个新手常见Python运行时错误
当初学 Python 时,想要弄懂 Python 的错误信息的含义可能有点复杂。这里列出了常见的的一些让你程序 crash 的运行时错误。1)忘记在 if , elif , else , for , while , class ,def 声明末尾添加 :(导致 “SyntaxError :inval...
分类:编程语言   时间:2015-04-25 15:04:10    阅读次数:162
#if #elif #define typedef 使用时的注意事项
假设有如下代码需要兼容三个版本 这样无法完成任务的 无论 typedef enum{ FIRST, SECOND, THIRD, }; #define NUM THIRD #if (NUM == FIRST) #define VAR 1 #elif(NUM == SECOND) #define VAR 2 #elif(NUM == THIRD) #defi...
分类:其他好文   时间:2015-04-24 01:07:29    阅读次数:115
今天练习了一下用python写函数,就把它记录到博客上吧 冒泡排序和素数判断
第一个是判断素数,先上代码吧: 1 from math import sqrt 2 def is_prime(i): 3 if i == 2: 4 return True 5 elif i list[e+1]: list[e],list[e+1...
分类:编程语言   时间:2015-04-22 00:01:12    阅读次数:349
Python-条件、循环、
1、条件:age = 3if age >= 18: print 'adult'elif age >= 6: print 'teenager'else: print 'kid'不能少了: elif2、循环一种是for ...in...names = ['Machael','Bob',...
分类:编程语言   时间:2015-04-19 17:27:18    阅读次数:158
966条   上一页 1 ... 87 88 89 90 91 ... 97 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!