Комментарии:
Thank you so much! you saved me and i finally completed my assignment
Ответитьthanks hero
ОтветитьThanks, this helped me a ton with creating my own program.
Ответитьwhat output = {**input} does in python where input is a dict
ОтветитьWhat if you would like to search the dictionary by value asking the user to put in that value
Ответить@tony Staunton. Can u share the code for nested dictionary by user input?
Ответитьrental_pro [name]= rental_pro (did not work )
ОтветитьSir I don't understand this portion
Store the username in the empty dictionary ..
how do you attach more than 2 keys? like username, address, phone-number ?
Ответитьrental_properties = {}
rental_open = True
while rental_open:
username = input("\nWhat is your name ?")
rental_property = input("What is the address of the property you want to rent ?")
rental_properties[username] = rental_property
repeat = input("\nDo you know anyone who might rent some properties ?")
if repeat == "no":
rental_open = False
print("\n~~~Property to rent~~~")
for username,rental_property in rental_properties.items():
print(username+"has"+rental_property+"to rent")
please explain class in brief. It seem very confusing to me ..like what is self , why we use self.
ОтветитьThankyou so much sir . wonderfull explanation
Ответитьif i have a dictionary with key:value stored, and say my key is 'add' and my value is a function to add two numbers together, how would i write the loop to take user input to call the function?
ОтветитьCould you possibly make a video on user inputs used in classes?
Ответить