Python Exam Questions and Answers 100% Pass
Python Exam Questions and Answers 100% Pass Given the following string: S = "Welcome: which code results in an error? - Correct Answer️️ -Print(S+1) What is the output of the following code? name = 123 if swith("a") print("welcome") - Correct Answer️️ -An error message Which statements evaluate True and without errors? (Choose all that apply.) - Correct Answer️️ -"The Title".istitle() "upper".islower() What is the order of precedence (from first to last) of the math operators? - Correct Answer️️ -*, /, +, - What is the output of the following code? print("She said, "Who's there?") - Correct Answer️️ -She said, "Who's there?" Which operator can be used to combine two strings? - Correct Answer️️ -+ Which is not a way to run a code cell in Jupyter Notebook? - Correct Answer️️ -Shift + R Which is an example of Python string addition that will run without error? - Correct Answer️️ -Falsenew_string = "Hello": + "World!" PriNt("Hello World") will not output the message "Hello World!". What will it result in? - Correct Answer️️ -NameErrorPDF DOCUMENT Which is a properly formatted Python print() function example? - Correct Answer️️ - print("Welcome the", 3, "New students!") Which code formats the string "Green" to "GREEN" - Correct Answer️️ -.upper() name = "SKYE HOMSI" print("y" in ()) What is the output from the above code? - Correct Answer️️ -True 1. greet(name) 2. name = input("enter your name: ") 3. greet(name) 4. def greet(person): u 5. print("Hi,", person) 6. greet(name) Which line or lines need to be removed from the above code so the program prints a greeting without error - Correct Answer️️ -linens 1 and 3 vehicle_type = "Truck" if vehicle_().startswith("P"): print(vehicle_type, 'starts with "P"') else: print(vehicle_type, 'does not start with "P"') What is the output from running the above code? - Correct Answe
Geschreven voor
- Instelling
- Python Programming
- Vak
- Python Programming
Documentinformatie
- Geüpload op
- 17 juni 2024
- Aantal pagina's
- 6
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
python exam questions and answers 100 pass
Ook beschikbaar in voordeelbundel