Skip to content

Instantly share code, notes, and snippets.

View Raj39120's full-sized avatar
😃

Raj_39120 Raj39120

😃
View GitHub Profile
a = int(input("Enter the length you want the game board to be: "))
b = int(input("Enter the width you want the game board to be: "))
for x in range(0, a):
print(" ---" * b)
print("| " * (b+1))
print(" ---" * b)
user_input = input("Enter a list of numbers from least to greatest over here: ")
user_input_2 = input("Enter the number you want to check to see if it's in the above list over here: ")
if user_input_2 in user_input:
print("This number is in the list you entered.")
if user_input_2 not in user_input:
print("This number is not in the list you entered.")
from random import randrange
from time import sleep
def cows_and_bulls_game_2():
a = randrange(1, 9)
b = randrange(1, 9)
c = randrange(1, 9)
d = randrange(1, 9)
print("This program runs the cows ands bulls game where a four-digit number is generated every time you play.")
def word_reversal_function():
user_input = raw_input("Enter a list of words over here: ")
broken_input = user_input.split(" ")
print(" ".join(broken_input[::-1]))
word_reversal_function()
class Student:
name = 0
age = 0
role_number = 0
math_marks = 0
english_marks = 0
science_marks = 0
def __init__(self):
pass
class Cost:
time = 0
sea = 0
pool = 0
umbrella = 0
table = 0
cost = 0
def __init__(self):
pass
def loop_and_constructing_list_solution():
user_input = input("Enter a list of numbers separated by a comma (x, y, z) over here: ")
my_list = []
for i in user_input:
if i in my_list:
continue
my_list.append(i)
print my_list
def fibonacci():
num = int(input("Enter how many numbers from the fibonacci sequence you would like to generate: "))
i = 1
if num == 0:
fib = []
return fib
elif num == 1:
fib = [1]
return fib
elif num == 2:
import time
def practice_12():
a = list(input("Enter a list of numbers separated by commas over here: "))
time.sleep(1)
print("The program will print the first and last numbers of your list.")
time.sleep(1)
print(a[::len(a)-1])
practice_12()
def prime_number():
print("This program determines if a number is prime or not.")
print("This program will only accept integers.")
number = input("Please enter the number you want to check over here: ")
number = int(number)
if number > 0:
if number == 3:
print("The number is prime.")
choice = input("Do you want to enter another number? Type 'continue' if you do & 'exit' if you don't: ")
if choice == 'continue':