当前位置:网站首页>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 offer05 Replace spaces
- 2.6 preliminary cognition of synergetic couroutines
- 2020-09_ Shell Programming Notes
- wpa_ cli
- 2020-10_ Development experience set
- Airflow installation jump pit
- 2020-11_ Technical experience set
- GCN thinking - word2vec directly calculates text classification
- [combinatorics] permutation and combination (example of permutation and combination)
- 023 ([template] minimum spanning tree) (minimum spanning tree)
猜你喜欢

Solve the problem of VI opening files with ^m at the end

Sword finger offer06 Print linked list from end to end

剑指Offer09. 用两个栈实现队列
![Sword finger offer04 Search in two-dimensional array [medium]](/img/c4/002c951f8d914aaea4f4133685ebd1.png)
Sword finger offer04 Search in two-dimensional array [medium]

Shutter widget: centerslice attribute

【附下载】密码获取工具LaZagne安装及使用

云计算未来 — 云原生

Alibaba is bigger than sending SMS (user microservice - message microservice)

Display time with message interval of more than 1 minute in wechat applet discussion area

LeetCode 0556. Next bigger element III - end of step 4
随机推荐
error: expected reference but got (raw string)
【嵌入式】---- 内存四区介绍
Official website of Unicode query
剑指Offer03. 数组中重复的数字【简单】
Is it safe to open an account for online stock speculation? Who can answer
Apache Mina开发手册
node的ORM使用-Sequelize
Adult adult adult
双链笔记·思源笔记综合评测:优点、缺点、评价
Summary of error prone knowledge points: Calculation of define s (x) 3*x*x+1.
The solution to change the USB flash disk into a space of only 2m
145. Post order traversal of binary tree
雲計算未來 — 雲原生
云计算未来 — 云原生
Solve the problem of VI opening files with ^m at the end
MySQL time zone solution
elastic_ L04_ introduction. md
232. Implement queue with stack
347. Top k high frequency elements
Lambda expression