Monday, 7 February 2022

Python practice programs for beginners - Day9

 

Python practice programs for beginners - millioninformations


Day 8 solution:


Program

x and y is False
x or y is True
not x is False
Solution

Day 9:

if statement:

Syntax:

if condition:
    #Statements to be executed once the condition is True

Example:

number=10

if  number>0:
    print("The number is positive")


Output:
   The number is positive


Task:

Try to get two single-digit numbers from the user then add the two numbers and if the addition of those two numbers is above 10 then print "You score greater than 10". If the addition is below 10 then print "You score less than 10".

Will see the solution in next post.









1 comment :