当前位置:网站首页>Kung Fu pays off, and learning is done
Kung Fu pays off, and learning is done
2022-07-03 12:35:00 【iWillook】
#
# main.py
# Some Python Program
#
# Created by Mewlan Musajan on 4/27/21.
#
print(range(10))
rangeList = list(range(10))
print(rangeList)
for number in range(10):
if number in (3, 4, 7, 9):
print("number is in it")
break
else:
continue
else:
pass
if rangeList[1] == 2:
print("the second item is 2")
elif rangeList[1] == 3:
print("the second item is 3")
else:
print("Donno")
while rangeList[1] == 1:
print("We are trapped in an infinite loop!")
break
funcvar = lambda x: x + 1
print(funcvar(1))
def passingExample(someList, someInt, someString = "A default string"):
someList.append("a new item")
someInt = 4
return someList, someInt, someString
someList = [1, 2, 3]
someInt = 10
print(passingExample(someList, someInt))
class SomeClass(object):
common = 10
someVariable = 0
def __init__(self):
self.someVariable = 3
def someFunction(self, someArgument, anotherArgument):
return self.someVariable
someClass = SomeClass()
someClass.someFunction(1, 2)
anotherClass = SomeClass
print(anotherClass.common)
SomeClass.common = 30
class AnotherClass(SomeClass):
def __init__(self, someArgumentment):
self.someVariable = 3
print(someArgumentment)
def someMethod(self, someInt, someString):
someInt += 1
someString += " world"
if someInt == 1:
someInt = "One day,"
else:
someInt = "%s days passed," % someInt
return "%s I said %s to myself." % (someInt, someString)
someAnotherClass = AnotherClass("hello")
print(someAnotherClass.someVariable)
print(someAnotherClass.someMethod(1, "hello"))
边栏推荐
- Sword finger offer06 Print linked list from end to end
- Day 1 of kotlin learning: simple built-in types of kotlin
- repo Manifest Format
- Wechat applet pages always report errors when sending values to the background. It turned out to be this pit!
- RedHat5 安装Socket5代理服务器
- JVM内存模型
- Kubectl_ Command experience set
- Official website of Unicode query
- 2020-10_ Development experience set
- Self made pop-up input box, input text, and click to complete the event.
猜你喜欢
随机推荐
Kubectl_ Command experience set
Pki/ca and digital certificate
Applet wxss introduction
剑指Offer06. 从尾到头打印链表
Shell: basic learning
Sword finger offer04 Search in two-dimensional array [medium]
Apache Mina开发手册
Shutter: add gradient stroke to font
(最新版) Wifi分销多开版+安装框架
Airflow installation jump pit
ES6 standard
Unicode查询的官方网站
Official website of Unicode query
Pytext training times error: typeerror:__ init__ () got an unexpected keyword argument 'serialized_ options'
写一个简单的nodejs脚本
Lambda expression
2.9 overview of databinding knowledge points
Wechat applet - basic content
Is it OK to open an account for online stock speculation? Is the fund safe?
【附下载】密码获取工具LaZagne安装及使用









![Sword finger offer03 Repeated numbers in the array [simple]](/img/cf/c1ad2f2a45560b674b5b8c11fed244.png)