Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a one line thing
#1
for fun, a challenge (but don't spill any beer): define 2 functions, a() and b() where a() calls b() and b() prints out "hello world", and call a(). not very challenging? do it in the python command line -c option.

* Skaperen predicts wavic will be the winner
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
python3 -c "a = lambda: b(); b = lambda: (print('Hello World'), a()); a()"

New Task: Do a similar thing without hitting the recursion limit.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#3
i get that recursion, too. why use lambda instead of def?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  this thing i have created for Linux rocks! Skaperen 3 2,893 Feb-08-2018, 01:51 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020