1. Try to understand Boolean variables or expressions and the data type bool by writing a program for the following. a. Define a variable (var_a) and assign 0 to it. What do you think will be displayed when you type bool(var_a)? Think aboit your answer before you type the expression. b. Assign to var_a, the value 4. What do you think will be displayed when you type bool(var_a)? Think about your answer before you type the expresion. c. Assign 34 to var_a. What do you think will be displayed when you type boollvar_al? Think about your answer before you type the expression. d. Assign 3.75 to var_a. What do you think will be dinplyyed when you type bool(var_a)? Think about your answer before you type the expression. e. Based on (a).(c), what are the Boolean values for zero, and non-sero numbers? f. Define three variables {x,y,z} and assign the values 2,5 and 30 to them, respectively. What do you think the following Boolean expressions will evaluate to? Using the print function. i. (15+x+y)>(z5) ii. x
(x+4)z iv. (x2)=(y+5) v. (x2)y 2. Try to understand the if statement and if else (single and doal aternatives). a. Write a program that will prompt the user to enter a string and assign to variable astring. The program will display "Your" + astring + "did not match the hidden string" if astring does not match "Module" b. Write a progam that will prompt the user to enter a string and assign to variable astring. The program will display "Your" + astring + " matches the hidden string" if astring does matches "Module" c. Write a program that will prompt the user to two integess and assigh to variables aNum and bNum. The program will calculate and display the maimum of the two numbers. Do not use the built-in function, write you own function. d. Write a progam that will prompt the user to two integers and assign to variables aNum and bNum. The program will calculate and display the minimum of the two numbers. Do not use the built-in function, write you own function. e. Write a program that will prompt the user to enter a string representing the model of a car. If the string is " A " or " a ", the propram will display 51200 as the grice of the car, otherwise, display zero as the price. f. Write a function that will prompt the user to enter a string and assien to variable astring. The program will display "Your" + astring + "did not match the hidden string" if astring matches the string "Module" otherwise, the program will dinglay "Your" + string + "matches with the hidden string" g. Write a program that will prompt the user to enter two integen and assien to variables aNum and bNum. The program will display strf(aNum) + "is greater than " + str(bNum) if aNum is greater than bNum, otherwise, the program will diplay str(aNum) + " is less than