# Python Programming Quiz 1

11 Questions | Total Attempts: 256  Settings  End of first quarter test.

Related Topics
• 1.
Without using Python to check your results, write the code here that will ask someone to input their first name and then their last name (2 input statements) and then print them out on the same line.
• 2.
Read through the following code for the computer to guess a number.  There are 2 lines in bold.  Why is the starting number "+1" and the ending number "-1"import random print "Please enter the range you would like me to guess from."starting = input("Enter starting number: ")ending = input("Enter ending number: ")your_num = input("Enter your number: ") guess = "F" while guess == "F":     comp_guess = random.randint(starting,ending)     if comp_guess == your_num:        guess = "T" import random print "Please enter the range you would like me to guess from."starting = input("Enter starting number: ")ending = input("Enter ending number: ")your_num = input("Enter your number: ") guess = "F" while guess == "F":     comp_guess = random.randint(starting,ending)     if comp_guess == your_num:        guess = "T"     elif comp_guess > your_num:        print "% .0f is too high" % comp_guess        ending = comp_guess - 1    else:        print "% .0f is too low" % comp_guess        starting = comp_guess +1 print "I guesed your number % .0f" %comp_guess print "I guesed your number % .0f" %comp_guess
• 3.
In the following code, what does bileng equal (represent)?binary = raw_input("Enter a Binary Number: ")bileng = len(binary)
• 4.
What is wrong with thr follong code?while guess = "F":
• 5.
What is missing at the end of the following line? if x<=5
• A.

;

• B.

#

• C.

.

• D.

:

• 6.
Which is correct if the input I want is specifically a number?
• A.

• B.

• C.

• D.

• 7.
A1=random._______(1,10)
• 8.
Which of the following are correct?
• A.

Print " Hello World "

• B.

Print = "Hello World"

• C.

Print " 'Hello World' "

• D.

Print ' Hello Word '

• 9.
Write a statement that picks a random number between 7 and 35 using the variable name "number"
• 10.
______ = input("please enter a number")
• 11.
What line of code is necessary before executing a cammand picking a random number?