Write an expression that evaluates to True if and only if the value of x is equal to zero.
  • s!="end"
  • x == 0
  • s=="end"
  • x >= y
Write an expression that evaluates to True if x is greater than or equal to y.
  • profits==losses
  • s!="end"
  • is_a_member==False
  • x >= y
Assume that c is a variable that has been assigned a string value. Write an expression whose value is true if and only if c is a space character.
  • c == '\n'
  • x>=0 and y<0
  • c=="\t"
  • c == " "
Given two variables , is_empty of type bool, indicating whether a class roster is empty or not, and number_of_credits of type integer, containing the number of credits for a class, write an expression that evaluates to True if the class roster is not empty and the class is one or three credits.
  • not is_empty and (number_of_credits==1 or number_of_credits==3)
  • is_empty==True or number_of_credits==3
  • if x<=y and x<=z: min=xif y<=x and y<=z: min=yif z<=x and z<=y: min=z
  • number_of_men >= number_of_women
Write a conditional that decreases the value associated with shelf_life by 4 if the value associated with outside_temperature is greater than 90.
  • if outside_temperature > 90: shelf_life -= 4
  • if temperature > 98.6: fever = True
  • if age >= 65: senior_citizens += 1else: non_seniors += 1
  • if worked_overtime== True: pay *= 1.5
Write an expression that evaluates to True if the str associated with s1 is greater than the str associated with s2.
  • worked_overtime==True
  • is_a_member==False
  • profits==losses
  • str(s1)>str(s2)
Write a program that assigns two integer values from standard input to the variables int1 and int2, then prints "True" if they are equal, and "False" if they are not.
  • int1=int(input())int2=int(input())if int1==int2: print("True")else: print("False")
  • if age<18: minors+=1 elif age>=65: seniors+=1else: adults+=1
  • if sold_yesterday > sold_today: sales_trend = -1else: sales_trend = 1
  • time=input("Enter number of seconds:")t=int(time)d=int(t//86400)z=t/86400-dp=z*86400h=int(p//3600)y=p/3600-hj=y*3600m=int(j//60)b=j/60-mr=int((b+.0000001)*60)s=int(r//1)print(d,"day(s),",h,"hour(s),",m,"minute(s), and",s, "second(s).")
Clunker Motors Inc. is recalling all vehicles from model years 1995-1998 and 2004-Given a variable modelYear write a statement that assigns true to norecall if the value of modelYear does NOT fall within the two recall ranges and assigns false otherwise.Do not use an if statement in this exercise!
  • not is_empty and (number_of_credits==1 or number_of_credits==3)
  • norecall = not((modelYear >= 1995 and modelYear<=1998) or (modelYear >=2004 and modelYear<=2006))
  • if ph<7: neutral=0 base=0 acid=1elif ph>7: neutral=0 base=1 acid=0elif ph==7: neutral=1 base=0 acid=0
  • int1=int(input())int2=int(input())if int1==int2: print("True")else: print("False")
Given the variable c, whose associated value is a str, write an expression that is True if and only if c is not equal to a string consisting of a single blank.
  • c != str(" ")
  • c == " "
  • number_of_men >= number_of_women
  • x>=0 and y<0
Given the already defined variables is_full_time_student and age, write an expression that evaluates to True if age is less than 19 or is_full_time_student is True.
  • age<19 or is_full_time_student==True
  • number_of_men >= number_of_women
  • years_with_company<5 and department!=99
  • temperature>90 and humidity<10
Write an expression that evaluates to True if and only if is_a_member is False.
  • str(s1)>str(s2)
  • s=="end"
  • is_a_member==False
  • worked_overtime==True
Given x and y, each associated with an int, write a fragment of code that associates the larger of these with another variable named max.
  • if x > y:max=xelse: max=y
  • gross_pay < 10000
  • if worked_overtime== True: pay *= 1.5
  • x>=0 and y<0
Assume that a variable variable , numberOfSides has been initialized. Write a statement that assigns the value True to the variable isQuadrilateral if numberOfSides is exactly 4 and False otherwise
  • number_of_men >= number_of_women
  • isQuadrilateral=numberOfSides== 4
  • temperature>90 and humidity<10
  • years_with_company<5 and department!=99
Given two variables , is_empty which is associated with a bool indicating whether a class roster is empty or not, and number_of_credits which is associated with an int (the number of credits for a class), write an expression that evaluates to True if the class roster is empty or the class is exactly three credits.
  • not is_empty and (number_of_credits==1 or number_of_credits==3)
  • is_empty==True or number_of_credits==3
  • temperature>90 and humidity<10
  • number_of_men >= number_of_women
Initialize the variable oneSpace, to a string consisting of a single space.
  • profits==losses
  • s!="end"
  • oneSpace=" "
  • s=="end"
Write an if/else statement that compares age with 65, adds 1 to senior_citizens if age is greater than or equal to 65, and adds 1 to non_seniors otherwise
  • if age<18: minors+=1 elif age>=65: seniors+=1else: adults+=1
  • if outside_temperature > 90: shelf_life -= 4
  • if age >= 65: senior_citizens += 1else: non_seniors += 1
  • if sold_yesterday > sold_today: sales_trend = -1else: sales_trend = 1
Write an expression that evaluates to True if and only if the bool associated with worked_overtime is True.
  • worked_overtime==True
  • is_a_member==False
  • str(s1)>str(s2)
  • profits==losses
Given the variables number_of_men and number_of_women, write an expression that evaluates to True if the number of men is greater than or equal to the number of women.
  • age<19 or is_full_time_student==True
  • number_of_men >= number_of_women
  • years_with_company<5 and department!=99
  • temperature>90 and humidity<10
The colors red, blue, and yellow are known as the primary colors because theycannot be made by mixing other colors. When you mix two primary colors, you geta secondary color:When you mix red and blue, you get purple.When you mix red and yellow, you get orange.When you mix blue and yellow, you get green.Design a program that prompts the user to enter the names of two primary colors,one at a time. If the user enters anything other than "red," "blue," or"yellow," the program should print "You didn't input two primary colors."Otherwise, it should print something in the format:"When you mix red and blue, you get purple."(Assuming the user entered "red" and "blue".)
  • time=input("Enter number of seconds:")t=int(time)d=int(t//86400)z=t/86400-dp=z*86400h=int(p//3600)y=p/3600-hj=y*3600m=int(j//60)b=j/60-mr=int((b+.0000001)*60)s=int(r//1)print(d,"day(s),",h,"hour(s),",m,"minute(s), and",s, "second(s).")
  • primary_color1 = input("Enter primary color:")primary_color2 = input("Enter primary color:")if (primary_color1 == "red" and primary_color2 == "blue") or (primary_color1 == "blue" and primary_color2 == "red"): print("When you mix red and blue, you get purple.")elif (primary_color1 == "blue" and primary_color2 == "yellow") or (primary_color1 == "yellow" and primary_color2 == "blue"): print("When you mix blue and yellow, you get green.")elif (primary_color1 == "yellow" and primary_color2 == "red") or (primary_color1 == "red" and primary_color2 == "yellow"): print("When you mix yellow and red, you get orange.")else: print("You didn't input two primary colors.")
  • norecall = not((modelYear >= 1995 and modelYear<=1998) or (modelYear >=2004 and modelYear<=2006))
  • is_empty==True or number_of_credits==3
Assign true to the variable hasPassedTest.
  • worked_overtime==True
  • profits==losses
  • oneSpace=" "
  • hasPassedTest=True
Given the variables x, y, and z, each associated with an int, write a fragment of code that assigns the smallest of these to min.
  • number_of_men >= number_of_women
  • if x<=y and x<=z: min=xif y<=x and y<=z: min=yif z<=x and z<=y: min=z
  • age<19 or is_full_time_student==True
  • x>=0 and y<0
Given the already defined variables temperature and humidity, write an expression that evaluates to True if and only if temperature is greater than 90 and humidity is less than 10.
  • number_of_men >= number_of_women
  • temperature>90 and humidity<10
  • years_with_company<5 and department!=99
  • is_empty==True or number_of_credits==3
Write an if/else statement that adds 1 to minors if age is less than 18, adds 1 to adults if age is 18 through 64 and adds 1 to seniors if age is 65 or older.
  • if x<=y and x<=z: min=xif y<=x and y<=z: min=yif z<=x and z<=y: min=z
  • if outside_temperature > 90: shelf_life -= 4
  • if age >= 65: senior_citizens += 1else: non_seniors += 1
  • if age<18: minors+=1 elif age>=65: seniors+=1else: adults+=1
Write a program that asks the user to enter a number of seconds and then printsthe same amount of time in days, hours, minutes, and seconds.For example, 3667 seconds is equivalent to 0 days, 1 hour, 1 minute, and 7 seconds.Print out the result in the format:"0 day(s), 1 hour(s), 1 minute(s), and 7 second(s)."
  • not is_empty and (number_of_credits==1 or number_of_credits==3)
  • time=input("Enter number of seconds:")t=int(time)d=int(t//86400)z=t/86400-dp=z*86400h=int(p//3600)y=p/3600-hj=y*3600m=int(j//60)b=j/60-mr=int((b+.0000001)*60)s=int(r//1)print(d,"day(s),",h,"hour(s),",m,"minute(s), and",s, "second(s).")
  • int1=int(input())int2=int(input())if int1==int2: print("True")else: print("False")
  • if sold_yesterday > sold_today: sales_trend = -1else: sales_trend = 1
Given an int variable gross_pay, write an expression that evaluates to True if and only if gross_pay is less than 10,000.
  • profits==losses
  • gross_pay < 10000
  • x>=0 and y<0
  • str(s1)>str(s2)
Write an expression that evaluates to True if and only if s refers to the str "end".
  • s!="end"
  • s=="end"
  • x >= y
  • x == 0
Given the already defined variables years_with_company and department, write an expression that evaluates to True if years_with_company is less than 5 and department is not equal to 99.
  • is_empty==True or number_of_credits==3
  • number_of_men >= number_of_women
  • temperature>90 and humidity<10
  • years_with_company<5 and department!=99
0 h : 0 m : 1 s

Answered Not Answered Not Visited Correct : 0 Incorrect : 0