Python assign functions to variables

Python assign functions to variables

Bro Code

3 года назад

20,934 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Bro Code
Bro Code - 07.01.2021 18:45

def hello():
print("Hello")


hi = hello
hi()

# say = print
# say("Whoa! I can't believe this works! :O")

Ответить
Hussain Ali
Hussain Ali - 01.11.2023 03:32

love u

Ответить
Alexandra Meas
Alexandra Meas - 09.10.2023 15:24

Thak you!

Ответить
Talk with Satyam Singh
Talk with Satyam Singh - 15.09.2023 21:39

Awesome !!

Ответить
Stranger
Stranger - 03.09.2023 09:42

TO PRINT THE LIST USING WALRUS OPERATOR, JUST ENCLOSED THE food and the input within parentheses as shown below:

foods = list()
while (food := input("What food do you like?: ")) != "quit":
foods.append(food)

print(foods)

# or...
for food in foods:
print(food)

Ответить
Bektur Asanbekov
Bektur Asanbekov - 09.07.2023 12:06

thx 4 vid bro !

Ответить
mohamed amine moufti
mohamed amine moufti - 08.07.2023 15:11

thanks you made a great job

Ответить
SAGADA M. STEPHEN
SAGADA M. STEPHEN - 08.06.2023 06:29

Thanks

Ответить
Rpatzz_z
Rpatzz_z - 22.01.2023 09:52

thanks bro

Ответить
Piotr Kopcewicz
Piotr Kopcewicz - 30.11.2022 21:48

Awesome !!

Ответить
Developer Portal
Developer Portal - 14.09.2022 12:50

Sir how to use it with formatted string -->
code:


def efdot():
bar = "⦾⦿"
index = 0
while True:
print(bar[index % len(bar)], end="\r")
index += 1
time.sleep(0.5)


dot = efdot
var = input(f"{dot}Hello World")


output:

<function efdot at 0x000001B3EA933E20>Hello World

Ответить
LW99
LW99 - 29.08.2022 12:01

say = print
say("Thank you Bro!")

Ответить
LW99
LW99 - 29.08.2022 12:01

RThank you bro!

Ответить
FE4R_ME
FE4R_ME - 27.08.2022 18:05

thanks it really helped me!!!

Ответить
أبو مصعب
أبو مصعب - 17.08.2022 11:32

Thanks!

Ответить
Mahyar
Mahyar - 11.07.2022 06:09

thank you so much, It was so informative

Ответить
BringBackDislikes
BringBackDislikes - 09.07.2022 18:45

Thank you!

Ответить
Ahiamata Gabriel
Ahiamata Gabriel - 19.06.2022 01:07

Thank you

Ответить
Yeager
Yeager - 11.05.2022 20:04

as always . the best :)

Ответить
Feyisayo Wemida
Feyisayo Wemida - 02.05.2022 21:02

Great video

Ответить
Huntress Artemis
Huntress Artemis - 21.04.2022 07:34

iam watching for a few days now, i started at the first video,, but damn i love you vids thank you sir

Ответить
yassine waterlaw
yassine waterlaw - 08.04.2022 07:23

For example in tkinter when we type a variable = Tk() it the same thing ??

Ответить
Ahmet Aydın
Ahmet Aydın - 25.02.2022 22:26

More python videos

Ответить
Being ZERO
Being ZERO - 31.01.2022 10:11

Wow!

Ответить
HENRIQUE FELINI MENA
HENRIQUE FELINI MENA - 05.01.2022 19:25

Thank you!

Ответить
Hulgorb
Hulgorb - 09.11.2021 02:12

awesome

Ответить
NahoyaEdits
NahoyaEdits - 09.08.2021 17:46

u deserve more then 100 like <3

Ответить
uuhju
uuhju - 13.07.2021 05:48

Thank you so much

Ответить
Mustafa ÜNLÜ
Mustafa ÜNLÜ - 23.03.2021 21:58

Thanks a lot for these unique videos Bro. I think this method, assigning functions to variables, is how people create new programming languages, right? I understood so.

Ответить
Computer Science Simplified
Computer Science Simplified - 11.01.2021 21:08

Awesome video, keep up the great work! :)

Ответить
Faiyaz Ahmad
Faiyaz Ahmad - 11.01.2021 20:58

Dude please add python projects for programmes

Ответить