Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
lfj
pythonLearning
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
pythonLearning
/
basicGrammer.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
89 lines (61 loc) · 1.26 KB
master
Breadcrumbs
pythonLearning
/
basicGrammer.py
Copy path
Top
File metadata and controls
Code
Blame
89 lines (61 loc) · 1.26 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# python 基础语法
import time; #引入time模块
print "你好,世界";
dict = {}
var1 = 1
del var1
s = 'ilovechina'
print s[0]
a = ['a', 'b', 'c']
ticks = time.time();
print "当前时间戳为", ticks
if True:
print "True"
else:
print "False"
# Python引号
word = 'word'
sentence = "这是一个句子"
paragraph = """这是一个段落包含了多个语句"""
# python注释
print "中国是一个伟大的国家"; #这是一个注释
'''
亚洲是世界上最大的洲
中国居于亚洲的中心,是中心之国
'''
"""
我是一个java程序员
但是我长期编写python代码
"""
#等待用户输入
# raw_input("按下 enter 键退出,其他任意键显示...\n")
#同一行显示多条语句
import sys; x = 'runoob'; sys.stdout.write(x + '\n')
# print输出
x = 'a'
y = 'b'
# 换行输出
print x
print y
# 不换行输出
print x,
print y
# 不换行输出
print x,y
# 获取系统输入参数
import sys
# print sys.argv
#python pass语句
for letter in 'Python':
if letter == 'h':
pass
print '这是 pass 块'
print '当前字母:', letter
print "Good bye!"
count = 0
while (count < 9):
print 'The count is:', count
count = count + 1
print "Good bye!"
You can’t perform that action at this time.