email_flag = False while not email_flag == True: s_email = input( 'Enter your email address: \n' 'Email has to be unique and cannot be modified later: ').lower() if (re.search(email_re, s_email)): reg_details['email'] = s_email email_flag = True else: print("Invalid Email...") # make instance of Student s1 = Student( student_name=reg_details['student_name'], email=reg_details['email'], course=reg_details['course'], ) print('\n') print('==========================================================') print(' CONFIRM registration ') print('==========================================================') confirm = input( "Hit any key to confirm or cancel by pressing 'Q' or 'q' key: ") if confirm in ['q', 'Q']: print('\nRegistration has been cancelled!') else: print('You have been registered successfully\n' 'Here, is your course details:\n') course_detail = s1.confirm_registration()
def parseStudent(line): split_line = line.split() new_student = Student(split_line[0], split_line[1], split_line[2].strip(), split_line[3], split_line[4]) return new_student
#!/usr/bin/env python3 from students import Student from students import CollegeStudent #create student objects student1 = Student("Lina", "Breunlin", 2055392, "Estrella Mountain Community College", "Senior") #print student data to console print("Student Information:") print("Name: " + student1.first_name + " " + student1.last_name) print("Student ID: " + str(student1.ID)) print("School: " + student1.school_name) print("Grade Level: " + student1.grade_level) print() print() #create college student object college1 = CollegeStudent("Lina", "Breunlin", 2055392, "Estrella Mountain Community College", "Senior", "Programming and System Analysis", "July 30, 2020") print("College Student Information:") print("Name: " + college1.first_name + " " + student1.last_name) print("Student ID: " + str(college1.ID)) print("School: " + college1.school_name) print("Grade Level: " + college1.grade_level) print("Majorl: " + college1.major) print("Graduation Date:" + college1.grad_date)
#------------------------------ # IMPORT STUDENT CLASS #------------------------------ # From the 'students' module import the 'Student' class from students import Student #------------------------------ # CREATE STUDENT OBJECTS #------------------------------ # Note the syntax: # variable = class(parameter, parameter, parameter) student1 = Student("James", "Economics", 3.7) student2 = Student("John", "Psychology", 3.4) student3 = Student("Brendan", "General Studies", 2.7) student4 = Student("Jamie", "Law", 4.0) # print (variable.class-function()) print(student1.on_honor_roll())
from instructor import Instructor from students import Student ex_1 = Exercise( "1", "python", ) ex_2 = Exercise("2", "python") ex_3 = Exercise("3", "python") ex_4 = Exercise("4", "python") three_six = Cohort("Cohort 36") three_seven = Cohort("Cohort 37") three_eight = Cohort("Cohort 38") erin = Student("Erin", "Polley", "erin", "Cohort 36") corri = Student("Corri", "Golden", "corri", "Cohort 36") bito = Student("Bito", "Mann", "bito", "Cohort 38") matt = Student("Matt", "Cragg", "cragg", "Cohort 36") joe = Instructor("Joe", "Shepherd", "joe", "Cohort 36", "80s jokes") jisie = Instructor("Jisie", "David", "jisie", "Cohort 36", "polite shut ups") jenna = Instructor("Jenna", "Solis", "jenna", "Cohort 36", "fashion and knowing her shit") joe.assign_exercise(matt, ex_1) jisie.assign_exercise(bito, ex_2) jenna.assign_exercise(corri, ex_3) def exercise_list(list):