# How to generate a pseudo-random number with PyTeal

**URL:** <https://forum.algorand.co/t/how-to-generate-a-pseudo-random-number-with-pyteal/5443>\
**Category:** General\
**Tags:** teal, smart-contracts\
**Created:** [December 16, 2021, 6:19pm UTC](https://forum.algorand.co/t/how-to-generate-a-pseudo-random-number-with-pyteal/5443 "2021-12-16T18:19:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Ben](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.algorand.co/ben/32/1979_2.png) [@Ben](https://forum.algorand.co/u/Ben)\
**Post date:** [December 16, 2021, 6:29pm UTC](https://forum.algorand.co/t/how-to-generate-a-pseudo-random-number-with-pyteal/5443/2 "2021-12-16T18:29:33Z")

</div>

Here is a good article on pseudo random number generation. Of course, do not use in any context that requires true randomness.

> **[Bottle shooter smart contract using PyTeal and TypeScript](https://developer.algorand.org/tutorials/bottle-shooter-smart-contract-using-pyteal-and-typescript/)**
>
> Generate a pseudo random number from a contract and use it for a web page game.

---

_[View the full topic](https://forum.algorand.co/t/how-to-generate-a-pseudo-random-number-with-pyteal/5443)._
