0

Вопрос по python – Python 3.2, как передавать данные в переменных между функциями

Error: User Rate Limit Exceeded

import random
from random import randrange

def main():
    r = random.randrange(1,13,1)
    print (r)

r = random.randrange(1,13,1)


def two():
    if r==7 or r==11:
       print (r)
    else:
       print (r)

  main()
  two()
  • Error: User Rate Limit Exceededaccept it.

    от
  • Error: User Rate Limit Exceeded

    от user1316212
  • Error: User Rate Limit Exceeded

    от user1316212
  • Error: User Rate Limit Exceeded

    от user1316212
  • Error: User Rate Limit Exceededrandom.getstateError: User Rate Limit ExceededrandomError: User Rate Limit Exceeded

    от Karl Knechtel
  • Error: User Rate Limit Exceeded

    от user1316212
  • 1

    Error: User Rate Limit Exceeded

    def main():
      ...
      r = do_something()
      ...
      return r
    
    def two(r):
      ...
      do_something_else(r)
      ...
    
    r = main()
    two(r)
    

    class Main():
      def main(self):
        ...
        self.r = do_something()
        ...
    
      def two(self):
        ...
        do_something_else(self.r)
        ...
    
    main = Main()
    main.main()
    main.two()
    

  • 2

    Error: User Rate Limit Exceeded

    import random
    from random import randrange
    
    def main():
        r = random.randrange(1,13,1)
        return r
    
    def two(r):
        if r==7 or r==11:
           print (r)
        else:
           print (r)
    
    r = main()
    two(r)
    

    mainrr = main()r

    twodef two(r):tworr