-
-
Save slyy97/301649c1509b3cc94502071572375b83 to your computer and use it in GitHub Desktop.
final.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"provenance": [], | |
"authorship_tag": "ABX9TyNT0LeGImmPntxGj2LoMINb", | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3" | |
}, | |
"language_info": { | |
"name": "python" | |
} | |
}, | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "view-in-github", | |
"colab_type": "text" | |
}, | |
"source": [ | |
"<a href=\"https://colab.research.google.com/gist/slyy97/301649c1509b3cc94502071572375b83/final.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "yCkgTZVWMwH_", | |
"outputId": "e0a26329-60cf-4c7d-dfb5-ca2d552f074e" | |
}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"Write start to dice roll: start\n", | |
"Result of dice rolling is : 1\n", | |
"roll agian\n", | |
"The numbers are: \n", | |
"4\n", | |
"1\n" | |
] | |
} | |
], | |
"source": [ | |
"import random\n", | |
"roll_dice = input(\"Write start to dice roll: \")\n", | |
"\n", | |
"if roll_dice == \"start\":\n", | |
" posiblle_results = [1, 2, 3, 4, 5, 6]\n", | |
" result = random.choice(posiblle_results)\n", | |
" print(\"Result of dice rolling is : \" + str(result))\n", | |
"\n", | |
"\n", | |
"\n", | |
"\n", | |
"def main():\n", | |
"\n", | |
" \n", | |
" import random\n", | |
" min = 1\n", | |
" max = 6\n", | |
"\n", | |
" reroll = \"yes\"\n", | |
"\n", | |
" while reroll == \"yes\" or reroll == \"y\":\n", | |
" print (\"roll agian\")\n", | |
" print (\"The numbers are: \")\n", | |
" print (random.randint(min, max))\n", | |
" print (random.randint(min, max))\n", | |
"\n", | |
" reroll = input(\"Do you want yo roll again? \")\n", | |
"\n", | |
"main()\n", | |
"\n" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment