21 questions • Select the best answer for each question
Which line is written CORRECTLY?
Which option correctly prints: Python's power
Which syntax creates a multiline string?
What will be the output? text = "Python" print(text[0])
What does this print? text = "Python" print(text[-1])
What will this code print? for char in "Hi": print(char)
What is the output? word = "Hello" print(len(word))
What will this print? text = "Hi there" print(len(text))
What is the output? text = "Python is powerful" print("power" in text)
Which line correctly uses single quotes inside double quotes?
What does this code print? text = " hello " print(text.strip())
What is the output? text = "Python" print(text[2])
What does this print? text = "Python" print(text[-2])
What will be printed? text = "PYTHON" print(text.lower())
What does this code output? text = "python" print(text.upper())
What will this print? text = "Learning Python" print(text[0:8])
What is the output? text = "Learning Python" print(text[-6:])
What does this code print? text = "Python is fun" print("Java" not in text)
How many times will this loop run? for ch in "Hey": print(ch)
What will be the output? text = " AI " print(len(text))
What does this print? text = " AI " print(len(text.strip()))