You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# round is a fucntion which rounds up a decimal number to whole i.e. 2.6 would be 3
# print(8/3) => 2.66666666
# print(round(8/3)) => 3
# print(round(8 / 3, 2)) => (3, 2) here 2 signifies that the number of places the decimal rounds up to i.e. 2.666 is actual output and with the code it becomes 2.67
# print(round(2.666666, 2)) => similar approach as of above
# // using the flow division would always give the output as a whole number rather than an decimal number which is usually the output of / when used
# print(8/3) => 2.66666 output is in float (decimal)
# print(8//3) => 2 output is in int (whole)
# inorder to resuse a calculation for a variable we can use a short hand like +=, /=, *= & -=
score = 0
# player scores a goal which means we have to add 1 to variable score
# traditional method score = score + 1
# score += 1
# print(score)
# f string is used where we have to reuse a variable inside a print statement without using + to concatenate
score = 0
height = 1.8
isWinning = True
# f-string
print(f"your score is {score}, your height is {height} and in this competition your wining is {isWinning}")
# Output => your score is 0, your height is 1.8 and in this competition your wining is True