Python入门-非计算机专业人士的编程指南

Python入门-非计算机专业人士的编程指南

5 (10人评价)
  • ¥9.90
  • 课时:(60)

  • 学员:(931)

  • 浏览:(27214)

  • 加入课程
  • 条件循环的笔记

    print("输入3继续循环,输入其他值退出循环。")someInput=input()while someInput=='3':    print("感谢你输入3")    print("输入3继续循环,输入其他值退出循环。")    someInput=input()print("你输入的不是3,退出循环。")  

  • 按步长计数的笔记

    for i in range(1,10,2):     print(i)

  • 没有数字的计数的笔记

     for cool_guy in ["Spongebob","Spiderman","Justin Timberlake","My Dad"]:    print(cool_guy,"is the coolest guy ever!") 

  • 是不是有问题的笔记

    num1=float(input("Enter the first number;"))num2=float(input("Enter the second number;"))if  num1 < num2:    print(num1,"is less than",num2)if  num1 > num2:    print(num1,"is greater than",num2)if  num1 == num2:    print(num1,"is equal to",num2)if  num1 != num2:    print(num1,"is not equal to",num2) 

  • 再看猜数游戏的笔记

    import random,easyguisecret = random.randint(1,99)guess = 0tries = 0easygui.msgbox("it a number between 1 to 99 ,you have 7 times to guess.")while guess != secret and tries < 7 :    guess = easygui.integerbox("a number you want :")    if not guess : break    if guess < secret :         easygui.msgbox(str(guess)+"too small,pig")    elif guess > secret :         easygui.msgbox(str(guess)+"too big,pig")    tries = tries + 1if guess == secret:    easygui.msgbox("well done,you get it")else :          easygui.msgbox("you have no chance,next time to play the  game !")

  • 通过 GUI 输入的笔记

    import easyguiflavor=easygui.buttonbox("你喜欢什么口味的冰激凌?",choices=["香草味","巧克力味","草莓味"])easygui.msgbox("你选择了"+flavor) import easyguinum=easygui.integerbox("你想填入什么数字?",title="输入整数",lowerbound=0,upperbound=1000)easygui.msgbox("你填写了"+str(num)) 

  • 开始编程的笔记

    print("i love pizza")print("pizza"*20)print("yum"*40)print("i'm full.")

  • 来自互联网的输入的笔记

    from urllib.request import urlopenimport sslssl._create_default_https_context = ssl._create_unverified_contextfile  = urlopen('heeps://www.huxiu.com/article/323011.html')message = file.read().decode(encoding="utf-8",errors="srrict")print(message)

  • 第二个 Python 程序的笔记

    import randomsecret = random.randint(1,100)guess = 0tries = 0print("a ha,i'm jack,i have a secret!")print("it is a number between 1 to 99,you have six times to guess,come on!")while guess != secret and tries < 6:    guess = int(input("a number:"))    if guess < secret:        print("too small")    elif guess > secret:        print("too big")    tries = tries + 1if guess == secret:    print("well done,you got it.")else:    print("you have no chance,next time.")    print("it is",secret) 

  • 开始编程的笔记

    ctrl+s保存文件

  • 风格问题-循环变量名的笔记

    讲的很好,一学就会,加油!

  • input()输入的笔记

    输入  处理 输出input()输入函数输入字符串

  • 第二个 Python 程序的笔记

    while    if   elif  import 关键词

  • 变量和内存(二)的笔记

    变量名命名规则1、只能由字母、数字、下划线(_)组成,不能使用其他字符。空格、标点符号和其他字符否是不允许的。2、变量名是区分大小写的。大小写不同,即为两个不同变量。3、变量名必须以字母或下划线开头,不能以数字开头,EG:4fun就不能作为变量名。4、一般(_)用于分割变量中两个单词,例如:first_number=15建议不要在变量名开始或末尾使用下划线,某些情况,在一个标识符的开始he末尾使用下划线字符会有特殊含义,所以要避免这样使用。

你感兴趣的课程

14万+浏览/ 10088学员/ 4.3评分
免费
办公软件 玩转 Excel 100 课
13万+浏览/ 467学员/ 4.8评分
¥16.00
13万+浏览/ 2449学员/ 4.5评分
免费