Question: python D Question 1 2 pts What does the following code print? if 2 - 2: print(online courses are great!) 04 O online courses are

python
python D Question 1 2 pts What does the following code print?
if 2 - 2: print("online courses are great!") 04 O online courses
are great! Nothing prints O None of the above options are rrect
Question 2 2 pts If a condition is evaluated to true, the
statement(s) of the if block are executed, otherwise the statement(s) in the
else block (if present) are executed O True O False Question 3

D Question 1 2 pts What does the following code print? if 2 - 2: print("online courses are great!") 04 O online courses are great! Nothing prints O None of the above options are rrect Question 2 2 pts If a condition is evaluated to true, the statement(s) of the if block are executed, otherwise the statement(s) in the else block (if present) are executed O True O False Question 3 2 pts True/False;"Dime" is the value printed by the following code. XS if x - 25 print("Quarter") elif X10: print("Dime") elif x 5 print("Nickel") elif x -- 1: print("Penny") else: print("Not a coin") O True False D Question 4 2 pts Which of the following is an example of tautology? O 1 1 A contradicton if val 100: o not (a == b and c != d) Question 5 2 pts One way to check multiple conditions in one Python statement is to use the "elif operator True O False Question 6 2 pts What does the following code print to the console? name = "marta" if name == "merissa": print("usa") elif name - "mary": print("ireland") else: print("colombia") colombia ireland usa Nothing prints Question 7 2 pts The output value produced by the following code, if the user entered the values 4 and 6, respectively, would be "Square" print "Enter length" length - input print "Enter width" width - input) if length width: print("Square") else: print("Rectangle") True False D Question 8 2 pts The result of the following statement is False (2**2-4 and False) or (not(16>15 or 1--3)) True False D Question 9 2 pts What is the printed output from the following? num - 3 if num > 0 print(num, "is a positive number.") print("This is always printed.") num - -1 if num > 0: print(num, "is a positive number.") print("This is also always printed.") 3 is a positive number This is always printed This is also always printed. This is always printed This is also always printed. 3 is a positive number This is always printed -1 is a positive number This is also always printed Nothing will print D Question 10 2 pts What would be printed from the following Python code if "myfile.txt" (without the quote marks) is input by the user? txt = Python is powerful and easy. filename = input('Enter file name:') app - filename.endswith('.txt') if app: print('OK') else: print('Invalid file type') OOK O Invalid file type Nothing prints O myfile.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!