vivo
4G 73%
•10:00 AM
4G 16
WHICH OF THE FOLLOWING IF
STATEMENT WILL NOT EXECUTE
FESSFULLY:
print('hello')
print(Melio')
if(1.2):
print('hello)
Answers
Answer:
name = input('What is your name? ')
x = int(input('How old are you? '))
if x >= 21:
print(name,'you are old enough.')
else:
print(name,'you are not old enough.')
Here is what happens if we enter the values Mark and 19:
What is your name? Mark
How old are you? 19
Mark you are not old enough.
In the example above the user is prompted to enter the name and age. The if statement will than evaluate whether the user if 21 or older and print the corresponding message. If the user enter a number less than 21, the else statement will be executed and the corresponding message will be printed. Note that the else statement will be executed only if the if statement evaluates to false. If the user enters a number greater or equal to 21, the code under the else statement will not be executed.
Here is another example:
x = int(input('Enter a number: '))
if x % 2 == 0: # checks whether the number is divisible by 2.
print('The number you have entered is an even number.')
else:
print('The number you have entered is an odd number.')
The output:
Enter a number: 5
The number you have entered is an odd number.
>>>
Enter a number: 67
The number you have entered is an odd number.
>>>
Enter a number: 100
The number you have entered is an even number.
Get user input
The if...elif statement
Explanation:
please please mark me brainliest
sorry mujhe nhi pta
Explanation:
iska matlab kiya hai