Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
4th Edition
ISBN: 9780134444321
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 11, Problem 4TF

Only the _ _init_ _method can be overridden.

Blurred answer
03:14
Students have asked these similar questions
What type must self be for the __str__ method?
class User:def __init__(self, first_name, last_name, user_id, last_login, password):self.first_name = first_nameself.last_name = last_nameself.user_id = user_idself.last_login = last_loginself.password = passworddef describe_user(self):print(f"Accessing user {self.user_id}:")print(f"{self.first_name} {self.last_name} last logged in on {self.last_login}")def greet_user(self):print(f"Welcome to the jungle {self.first_name} {self.last_name}, you gonna die")def new_login(self, month, day, year):if month < 1 or month > 12:print("That is not a valid month")returnif day < 1 or day > 31:print("That is not a valid day")returnif year < 0:print("That is not a valid year")returnmonths = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]month_name = months[month-1]self.last_login = f"{month_name} {day}, {year}"   Hard-Code:   # hard-coded callsjim =…
class User:def __init__(self, first_name, last_name, user_id, last_login, password):self.first_name = first_nameself.last_name = last_nameself.user_id = user_idself.last_login = last_loginself.password = passworddef describe_user(self):print(f"Accessing user {self.user_id}:")print(f"{self.first_name} {self.last_name} last logged in on {self.last_login}")def greet_user(self):print(f"Welcome to the jungle {self.first_name} {self.last_name}, you gonna die") Hard-code # hard-coded calls jim = User(first_name='Jim',last_name='Bob',user_id=1000,last_login='June 12, 1998',password='password123')jim.describe_user()jim.greet_user()joe = User('Joe','Bob',1001,'July 4, 2001','babygirl')joe.greet_user()joe.describe_user()joe.new_login(2, 3, 2025)joe.describe_user()joe.new_login(15, 3, 2025)joe.new_login(2, 35, 2025)joe.new_login(2, 3, -55)

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
    Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781305480537
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY