def get_positive_int(): while True: result = get_int() if result > 0: break return result
from inputs import get_int n = get_int() for i in range(n): print("hello")
from inputs import get_int x = get_int() y = get_int() if x == y: print(f"{x} is equal to {y}") else: print(f"{x} is not equal to {y}")
from inputs import get_int, get_string n = get_int() employees = [] for i in range(n): name = get_string("Enter a name > ") experience = get_int("Enter experience > ") employees.append({'name': name, 'experience': experience}) for e in employees: print(f"name : {e['name']}") print(f"experience : {e['experience']}")
def main(): scores = [] for i in range(SIZE): scores.append(get_int()) chart(scores, SIZE)
from inputs import get_int def chart(score_list): for i in range(len(score_list)): for j in range(score_list[i]): print("#", end="") print() if __name__ == '__main__': scores = [] for index in range(3): scores.append(get_int()) chart(scores)
from inputs import get_int x = get_int("Enter a number > ") y = get_int("Enter another number > ") if x > y: print(f"{x} is greater than {y}") elif x < y: print(f"{x} i less than {y}") else: print(f"{x} is equal to {y}")