Random, six number generator

Submitted by: 
Language: 
Visitors have accessed this post 193 times.

In this tutorial we will create a Simple Random Number Generator. This application can be use if you are hesitated for generating your own numbers. You just simply run this application and it will give you any numbers randomly. Python is an interpreted, high-level programming language with dynamic semantics. Beginners find Python a clean syntax and indentation structure based, and it is easy to learn because of its less semi colon problem.

#random number generator by Joel Campbell
import random
num1 = random.randint(1,50)
num2 = random.randint(1,50)
num3 = random.randint(1,50)
num4 = random.randint(1,50)
num5 = random.randint(1,50)
num6 = random.randint(1,50)
if num1 == num2 or num3 or num4 or num5 or num6:
num1 == num1/2
if num2 == num1 or num3 or num4 or num5 or num6:
num2 == num2/2
if num3 == num1 or num2 or num4 or num5 or num6:
num3 == num3/2
if num4 == num1 or num2 or num3 or num5 or num6:
num4 == num4/2
if num5 == num1 or num2 or num3 or num4 or num6:
num5 == num5/2
if num6 == num1 or num2 or num3 or num4 or num5:
num6 == num6/2
print (num1, num2, num3, num4, num5, num6)


Tags: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3> <iframe>
  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.