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: | |
def __init__(self, age, gender, first_name, last_name, identification, grade): | |
self.age = age | |
self.gender = gender | |
self.first_name = first_name | |
self.last_name = last_name | |
self.identification = identification | |
self.grade = grade | |
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 | |
def addition_problems(): | |
a = randrange(0, 10, 1) | |
print(" " + str(a)) | |
print("+") | |
b = randrange(0, 10, 1) | |
print(" " + str(b)) | |
print("-----") |
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
import math | |
import functools | |
def sum_of_list_of_numbers(): | |
list_of_numbers = list() | |
print("How many numbers do you want to include in this list?") | |
list_count = int(input()) | |
for i in range(list_count): | |
list_of_numbers.append(int(input("Enter the number you want to add to the list: "))) |
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 Calculator: | |
def __init__(self, number_1, number_2): | |
self.number_1 = number_1 | |
self.number_2 = number_2 | |
print("The sum of the two numbers is: " + str(number_1+number_2)) | |
print("The difference of the two numbers is: " + str(number_1-number_2)) | |
print("The product of the two numbers is: " + str(number_1*number_2)) | |
print("The quotient of the two numbers is: " + str(float(number_1)/float(number_2))) | |
print("Number 1 squared is: " + str(number_1**2)) | |
print("Number 2 squared is: " + str(number_2**2)) |
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
import random | |
from random import randrange | |
a = [] | |
for i in range(0, randrange(1, 20)): | |
n = random.randint(1, 100) | |
a.append(n) | |
b = [] | |
for i in range(0, randrange(1, 20)): | |
n = random.randint(1, 100) |
NewerOlder