Skip to content

Instantly share code, notes, and snippets.

View Raj39120's full-sized avatar
๐Ÿ˜ƒ

Raj_39120 Raj39120

๐Ÿ˜ƒ
View GitHub Profile
class Student:
name = 0
age = 0
role_number = 0
math_marks = 0
english_marks = 0
science_marks = 0
def __init__(self):
pass
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()
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.")
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.")
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)