当前位置:网站首页>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"))
边栏推荐
- Day 1 of kotlin learning: simple built-in types of kotlin
- Apprendre à concevoir des entités logicielles réutilisables à partir de la classe, de l'API et du cadre
- 最新版抽奖盲盒运营版
- Integer int compare size
- JVM内存模型
- If you can't learn, you have to learn. Jetpack compose writes an im app (II)
- LeetCode 0556.下一个更大元素 III - 4步讲完
- 剑指Offer04. 二维数组中的查找【中等】
- Use of atomicinteger
- Oh my Zsh + TMUX installation
猜你喜欢

Shutter widget: centerslice attribute

New features of ES6

社交社区论坛APP超高颜值UI界面

T430 toss and install OS majave 10.14

Sword finger offer07 Rebuild binary tree

Idea packages the web project into a war package and deploys it to the server to run

2021 autumn Information Security Experiment 1 (password and hiding technology)

Take you to the installation and simple use tutorial of the deveco studio compiler of harmonyos to create and run Hello world?

Eureka自我保护

【附下载】密码获取工具LaZagne安装及使用
随机推荐
20. Valid brackets
Sword finger offer09 Implementing queues with two stacks
Swift5.7 扩展 some 到泛型参数
repo Manifest Format
Comprehensive evaluation of double chain notes · Siyuan notes: advantages, disadvantages and evaluation
node的ORM使用-Sequelize
Day 1 of kotlin learning: simple built-in types of kotlin
SLF4J 日志门面
023(【模板】最小生成树)(最小生成树)
232. Implement queue with stack
Flutter: self study system
Flutter 退出登录二次确认怎么做才更优雅?
ES6新特性
Sqoop1.4.4原生增量导入特性探秘
145. Post order traversal of binary tree
在网上炒股开户可以吗?资金安全吗?
T430 toss and install OS majave 10.14
社交社区论坛APP超高颜值UI界面
Pytext training times error: typeerror:__ init__ () got an unexpected keyword argument 'serialized_ options'
Nodejs+Express+MySQL实现登陆功能(含验证码)