106k views
0 votes
Conditional Tests:

Write a series of conditional tests. Print a statement describing each test and your prediction for the results of each test. Your code should look something like this:
car = 'subaru'print("Is car == 'subaru'? I predict True.")print(car == 'subaru')print("\\Is car == 'audi'? I predict False.")print(car == 'audi')

1 Answer

3 votes

Answer:

1)

this:name='virat'

print("Is name == 'virat'? I predict True.")

print(car == 'virat')

print("\\Is name == 'Baber'? I predict False.")

print(name == 'Baber')

2)

this:Address='London'

print("Is address == 'London'? I predict True.")

print(address == 'London')

print("\\Is address == 'Surrey'? I predict False.")

print(address == 'Surrey')

3)

this:Gender='male'

print("Is Gender == 'Female'? I predict True.")

print(Gender == 'Female')

print("\\Is Gender == 'male'? I predict False.")

print(Gender == 'male')

4)

this:Serial Number='23'

print("Is Serial Number == '24'? I predict True.")

print(Serial Number == '24')

print("\\Is Serial Number == '23'? I predict False.")

print(Serial Number == '23')

Step-by-step explanation:

Conditions 1st and 2nd test for name and Address

Both conditions are true. Hence, true values are returned

Conditions 3rd and 4th tests for gender and Serial Number

Both conditions are false. Hence, false values are returned.

User Habizzle
by
5.5k points