Category: Python
monday_temperatures=[9.1,8.8,7.6] # print(round(monday_temperatures[0])) # print(round(monday_temperatures[1])) # print(round(monday_temperatures[2])) for temperatures in monday_temperatures: print(round(temperatures)) print(“done”) for letter in “Hello”:…
Playing With String in Function of Python def takData(input_data): return (“Hi my name is: {}”.format(input_data)) input_data=input(“Enter your…
user_input=input(“Enter your name: “) #message=”Hello %s” % user_input message=f”Hello {user_input}” print(message)
def mean(value): if type(value)==dict: the_mean=sum(value.values())/len(value.values()) else: the_mean = sum(value) / len(value) return the_mean monday_temperatures=(8.8,9.1,9.9) student_grades={“Marry”:9.1,”sim”:8.8,”John”:7.5} print(mean(monday_temperatures)) def…
def area(a): the_area=a*a return the_area print(area(7)) def foo(value): fluid=value*29.57353 return fluid print(foo(5))
Summary for python learning: Positive/Negative Indexes, Slicing: Lists, strings, and tuples have a positive index system: [“Mon”,…
Recent Comments