1 Star 0 Fork 0

北京大学-夏敏/Python_XDRupdate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
my first commit.py 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
xdr1324 提交于 2020-11-08 15:11 . my first commit
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
# %load mymodule.py
#!/usr/bin/env python
# In[2]:
mytuple = ("apple", "banana", "cherry")
myit = iter(mytuple)
print(next(myit))
print(next(myit))
print(next(myit))
# In[3]:
mytuple = ("apple", "banana", "cherry")
for x in mytuple:
print(x)
# In[4]:
mystr = "banana"
for x in mystr:
print(x)
# In[5]:
def myfunc():
x = 100
print(x)
myfunc()
# In[6]:
def myfunc():
x = 100
def myinnerfunc():
print(x)
myinnerfunc()
myfunc()
# In[7]:
x = 100
def myfunc():
x = 200
print(x)
myfunc()
print(x)
# In[10]:
def greeting(name):
print("Hello, " + name)
import mymodule
mymodule.greeting("Bill")
# In[9]:
import mymodule
mymodule.greeting("Bill")
# In[ ]:
def greeting(name):
print("Hello, " + name)
person1 = {
"name": "Bill",
"age": 63,
"country": "USA"
}
# In[2]:
get_ipython().run_line_magic('run', 'mymodule.py')
# In[6]:
# %load mymodule.py
#!/usr/bin/env python
# In[2]:
mytuple = ("apple", "banana", "cherry")
myit = iter(mytuple)
print(next(myit))
print(next(myit))
print(next(myit))
# In[3]:
mytuple = ("apple", "banana", "cherry")
for x in mytuple:
print(x)
# In[4]:
mystr = "banana"
for x in mystr:
print(x)
# In[5]:
def myfunc():
x = 100
print(x)
myfunc()
# In[6]:
def myfunc():
x = 100
def myinnerfunc():
print(x)
myinnerfunc()
myfunc()
# In[7]:
x = 100
def myfunc():
x = 200
print(x)
myfunc()
print(x)
# In[10]:
def greeting(name):
print("Hello, " + name)
import mymodule
mymodule.greeting("Bill")
# In[9]:
import mymodule
mymodule.greeting("Bill")
# In[ ]:
def greeting(name):
print("Hello, " + name)
person1 = {
"name": "Bill",
"age": 63,
"country": "USA"
}
# In[ ]:
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/pkuecho/python_-xdr.git
git@gitee.com:pkuecho/python_-xdr.git
pkuecho
python_-xdr
Python_XDRupdate
master

搜索帮助