Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function Execution Times
#1
Hi,
If we want that any Python Function should work only once or twice then how can be done the same?
Thanks
Reply
#2
run once or twice.
Please explain a bit better and receive a better answer.
Reply
#3
import random

def any_python_function(something):
    print(something)


once_or_twice = random.choice((1,2))

for times in range(once_or_twice):
    any_python_function(once_or_twice)
Reply
#4
I want to execute the program in in two parts

first;
We input the password from user and store aside.

second ;
We again input password to give them access if first input password matches with second.

Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Different code execution times Wirbelwind94 4 700 Oct-06-2023, 12:30 PM
Last Post: snippsat
Sad Iterate randint() multiple times when calling a function Jake123 2 1,979 Feb-15-2022, 10:56 PM
Last Post: deanhystad
  Execution of Another Recursive Function muzikman 5 2,947 Dec-04-2020, 08:13 PM
Last Post: snippsat
  Calling the function to change the times chris0147 6 4,688 Aug-30-2017, 12:40 AM
Last Post: chris0147

Forum Jump:

User Panel Messages

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