Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d457a2b

Browse files
Create 04_Functions_to_variables.MD
1 parent 2800ba8 commit d457a2b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎Lecture_17/04_Functions_to_variables.MD

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
```py
2+
def hello():
3+
print("Hello")
4+
5+
# Assign function address to the variable
6+
print(hello) # <function hello at 0x01880850>
7+
hi = hello
8+
print(hi) # <function hello at 0x01880850>
9+
10+
hi = hello
11+
hi() # Hello
12+
say = print()
13+
say("Waah! I can't believe this works!!!")
14+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /