python基礎(1)-helloworld

搭建python運行環境

  1. 下載python安裝包
  2. 配置好環境變量,可參考此連接

第一個helloworld

1 #單行註釋
2 '''多行註釋'''
3 """多行註釋"""
4 print("hello world!")

練習

1 add_age = 1; 2 name = input("your name:"); 3 age = input("your age:"); 4 print("name is "+name+";age is "+str(int(age)+add_age));
1 true_num = 67; 2 input_num = int(input(">>:")); 3     if true_num==input_num: 4         print('true'); 5     elif input_num>true_num: 6         print('try smaller') 7     else: 8         print('try bigger');
相關文章
相關標籤/搜索