Aktywne Wpisy
Headcrab_B +61
My tylko chcemy wysłać was na śmierć. Czy naprawdę wymagamy od was tak wiele?
#wtf #bekazpodludzi #bekazprawakow #bekazkonfederacji #konfederacja #4konserwy #neuropa #pieklokobiet
#wtf #bekazpodludzi #bekazprawakow #bekazkonfederacji #konfederacja #4konserwy #neuropa #pieklokobiet
lipka +3
Do jakich seriali wracacie?
#seriale
Ja pewnie jak wielu The office, ale jeszcze podam The scrubs z sentymentu ( ͡° ͜ʖ ͡°)
#seriale
Ja pewnie jak wielu The office, ale jeszcze podam The scrubs z sentymentu ( ͡° ͜ʖ ͡°)
Mam taki kod:
class User:
def __init__(self, first_name, last_name, birth, gg, email):
"""basic information about user"""
self.first_name = first_name
self.last_name = last_name
self.birth = birth
self.gg = gg
self.email = email
def describe_user(self):
"""describe your user"""
info = self.first_name + " " + self.last_name + " " + str(self.birth) + " " + str(self.gg) + " " + self.email
return info.title()
def greet_user(self):
print("Hi! " + self.first_name.title())
wiktor = User("wiktor", "cwt", 1996, 123456, " wiktor@kds.pl")
print(wiktor.describe_user())
print(wiktor.greet_user())
ola = User("ola", "prd", 1996, 616724, "ola@kds.pl")
print(ola.describe_user())
print(ola.greet_user())
lena = User("lena", "kkt", 2015, 987654, "lena@kds.pl")
print(lena.describe_user())
print(lena.greet_user())
Problem jest taki, że w output mam coś takiego:
Wiktor Cwt 1996 123456 Wiktor@Kds.Pl
Hi! Wiktor
**None**
Ola Prd 1996 616724 Ola@Kds.Pl
Hi! Ola
**None**
Lena Kkt 2015 987654 Lena@Kds.Pl
Hi! Lena
**None**
Problem mam z tym, że ciągle wyświetla mi się wartość none, powie mi ktoś dlaczego ona się tam pojawia?
#naukaprogramowania #python
A potem ty jeszcze drukujesz pusty obiekt, czy coś w każdym razie niepotrzebnie
wiktor = User("wiktor", "cwt", 1996, 123456, " wiktor@kds.pl")
print(wiktor.describeuser())
wiktor.greet_user()
def greetuser(self):
return ("Hi! " + self.firstname.title())
Komentarz usunięty przez autora