This file contains hidden or 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
| """FizzBuzz Program | |
| The program will return "Fizz" for multiples of 3, "Buzz" for multiples of 5, "FizzBuzz" for multiples of 15. | |
| In Beginning, the program will require the user to give an input number(integer). | |
| The input number will be used in making list of numbers. | |
| The list of numbers are consist of integers from 1 to the input number. | |
| Meaning: Range(1, input+1) | |
| """ | |
| #Get an input of an integer from the user. |
This file contains hidden or 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
| '''Random Number Generator for the Korean Lottery called "Lotto" | |
| This program generates random numbers for Korea's the most popular lottery "Lotto" | |
| In Korean Lotto, A buyer selects six sets of numbers, each of them is in range of 1 to 45(including 45) | |
| This program generates six sets of numbers in range(1, 46): Meaning 1 to 45 are included. | |
| ''' | |
| #Function for making 6 numbersets in range(1, 46). Random Sampling without REPLACEMENT. | |
| import random |
This file contains hidden or 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
| #This is an python game of 'Rocks, Sissors, Papers' | |
| #A User can compete with the computer by select one of 'r', 's', 'p', which indicates 'Rock', 'Sissor', and 'Paper' | |
| #Computer, decides one of 'Rock', 'Sissor', 'Paper' as well, by using random.choice | |
| #After playing one game, the program will ask you whether want to play another game or not. | |
| import random | |
| #Function that changes input of ['r', 's', 'p'] as output of ['Rock', 'Sissor', 'Paper'] | |
| def rsp_func(user): | |
| if user == 'r': |
This file contains hidden or 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
| #Fibonacci Sequence Study | |
| #This program will find out 2 things: | |
| #1)Whether the given number is in fibonacci sequence, | |
| #2)If it is in the Fibonacci sequence, then shows the nth | |
| n = int(input('Please enter an integer:')) | |
| def fibo(n): | |
| if n in [1,2]: | |
| return 1 |
NewerOlder