This file contains 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 practice: | |
def __init__(self,name:str,age:int,height:int): | |
self._name = name | |
self._age = age | |
self._height = height | |
def get_age(self): | |
return self._age | |
def summary(self): | |
return f"Name:{self._name} , age : {self._age} and height : {self._height}" | |
persons = [practice('sayeed',20,50), |
This file contains 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 | |
names = [] | |
num = int(input("Enter the number of name you want to add : ")) | |
for i in range(num): | |
n = input(f"Enter {i+1} number name : ") | |
names.append(n) | |
random_name = random.choice(names) | |
count = 0 | |
print(names) | |
while True: |