
Python Intro (Week 1-2)
Quiz by H L
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
What is the output from the following segment of code:
print('Hello World')
Which of the following prints the following output:
Hello
How are you?
    Good to know you
Python IDLE offers Interactive and Development modes.
What is the output from the following segment of code:
string1 = 'Hello World'
print('string1[2:5]')
If the user input value is 'Travis', what is the output from the following segment of code:
userName = input("What is your name? ")
print("Hello", username)
If the user input values are 5 and 7, what is the output from the following segment of code:
num1 = input("Enter first number: ")
num2 = input("Enter second number: ")
n_sum = num1 + num2
print("The sum is " + n_sum)
If the user input value is 3, what is the output from the following segment of code:
num1 = int(input("Enter first number: "))
print("The square of " + str(num1) + " is " + str(num1*num1))
What is the output from the following segment of code:
string1 = 'Python Programming'
print(string1[-4:])
Which of the following is invalid?
Which of the following is true for variable names in Python?