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
class Student: | |
name = 0 | |
age = 0 | |
role_number = 0 | |
math_marks = 0 | |
english_marks = 0 | |
science_marks = 0 | |
def __init__(self): | |
pass |
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
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() |
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
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.") |
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
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.") |
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
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) |
OlderNewer