python 初始第一课笔记

Python is the most popular open-source software in the world .When you want to control something ,it is worth your learning. Now let`s go to learn it together.

Firstly,i will introduce a program to you the one i finished it as long as i had learnt the first lecture from the wibsite-class Wangyiyun ,a Chinese website.

1. when we want people press their numbers that they think it so cool num,we can use the function -  input(no matter what you type here ,then when you enter ,the program will remind you to press the numbers that interest you. ) .Just like this:  a=input(),however,when we calculate the b=a*a,we will find it wrong.not will correct the struture of the a with a= int(a),then we can calculate b=a*a,perfect result,yes?

2. When we are intended to make the programs start just like exe in windows,we can use #!/usr/bin/env python3 (notice:it is only used in linux or unix)

The following is my copy programs with some changes there.

a=input("press your wanted numbers")

a=int(a)

b=a*a-a-1

c=a*b

if (a<1):

    print("a<1")

    print(c)

else:

    print("a is not less than 1")

    print(c-a)

print("we are done with the program")

The important is user`s number by themselves and the  loops here.

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 8,120评论 0赞 10
  • 生活中最怕讲道理的人,他们有共同的特点,他们自信心强,感觉自己是最棒的,其他人肯定不能比自己优秀。如果你比他们...
    罗小少阅读 389评论 0赞 1
  • 6.植物僵尸足球联赛(中) 经过了一周的魔鬼训练,大家都对苹果教练耿耿...
    唐风遗人阅读 340评论 0赞 0
  • 一目标:2017年轻松收入20万的财富,实现脱单,早日找到我心中的善良,贤惠,漂亮,高挑(165cm)和知性的伴侣...
    宝松阅读 222评论 0赞 0
  • 作者|小猫插图|幸福家队友 1.****战胜内心的一丝怯懦 参加合肥班幸福家课程,与我而言是一个很久的期待,只是没...
    小猫说法阅读 392评论 0赞 1

友情链接更多精彩内容