title: Using variable inside the def function globaly
body: <p><strong>Here is my code</strong></p>
  <pre><code>@bot.message_handler(content_types=['text'])
  def welcome(message):
      bot.send_message(message.chat.id,&quot;Hello, &lt;b&gt;{0.first_name}&lt;/b&gt;!&quot;.format(message.from_user, bot.get_me()), parse_mode='html')
      sent = bot.send_message(message.chat.id,&quot;Enter your name&quot;.format(message.from_user, bot.get_me()), parse_mode='html')
      bot.register_next_step_handler(sent, hello)
  
  def hello(message):
      text = message.text
      print(text)
  print(text)
  
  
  bot.polling(none_stop=True, timeout=123)
  </code></pre>
  <p>Here I use librarie telebot. So When I attempt to use variable text globaly I always fail.</p>
  <p>I have an error: <strong>NameError: name 'text' is not defined</strong></p>
  <p>I have already attempted to use <strong>global</strong> parameter in a def but it wasn't succesfull.</p>