Day1:If else流程判断】的更多相关文章

if else流程判断 getpass在pycharm中无法使用,在命令行窗口中进入python环境可以使用. import getpassusername = input("username:") password = getpass.getpass("password:") print(username,password) python中缩进错误: 为什么python中强制缩进,因为python中不需要定义结束符.省去了结束符,子代码强制缩进让结构变得更清晰.…
如果学过C或者java C#等语言. 一定熟悉SWITCH这个流程判断 但是在kotlin中却没有这个.而是 使用了When来代替. 当什么时候. 下面我觉一个简单的例子: import java.util.* fun main (args: Array<String>) { var sc:Scanner=Scanner(System.`in`); var input=sc.next() when(input) { "a"->println(”输入了a“); &quo…
一.if...else语句 if 条件成立: 执行条件成立后的代码 else: 执行条件不成立的代码 注:注意有冒号,python会强制缩进!一般语句都必须顶格写,缩进是缩进一个tab键,等于4个空格 #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan _username = "Hiuhung Wan" _password = "abcd1234" username = input(&q…
判断输入的用户名:#Author:zww _username = "zww" _password = " username = input("username:") password = input("password:") if username == _username and password == _password: print("Welcome {user} login" .format(user=use…
在python中,流程控制语句为强制缩进(4空格) if username=='lmc' and password=='123456': print('Welcome User {name} login...'.format(name=username))else: print('Invalid username or password') 不能这样写: if 条件: do something... else: do something... print()#这个语句前敲了1个空格 会显示Ind…
_username='Lily' _password=' username=input("username:") password=input("password:") if _username==username and _password==password: print("Welcome user {name} login....".format(name=username)) else: print("Invalid usern…
declare v_job ) := 'Programmer'; v_sal number; begin if v_job = 'Programmer' then v_sal :; elsif v_job = 'Senior Programmer' then v_sal :; else v_sal :; end if; dbms_output.put_line(v_sal); end;…
BEGIN set @n=(SELECT count(day) from log where day=CURDATE()); THEN call m_LogInsert(); ELSE call m_LoginCheck(); end if; end…
count = 0 while True: #print('count:',count) if count == 3: print('you guess over 3 times!fuck off!') break age = int(input('Please guess the lmc age:')) if age == 18: print('yes,you got it!') break elif age < 18: print('think bigger…') else: print('…
while循环age_of_Jim = 56 count = 0 #开始计数while True: #循环代码 if count ==3:#如果次数=3 break#退出 guess_age = int(input("guess age:"))#int-->字符串转换数字 if guess_age == age_of_Jim:#如果猜的数字=Jim年龄 print("yes you got it.")#打印“yes you got it.” break #猜对…