What is the final result of the expression 4 + 5 * 3?, 27, 12, 21, 19, What is the final result of the expression 7 / 2 + 6?, 0, 9.5, 9, 0.875, Choose the print statement below that will cause an error. Assume num = 6 and name = "Isabella"., print(name + ":")\nprint(num), print(name + " wants " + "num " + "candies"), print(name + ": " + str(num)), print(name + ": " + num), Which statement below will cause an error?, ans = "hi" * 8, ans = "hi" + 9, ans = "hi" + "hi" + "hi", ans = ("a" * 4) + "b", What does the following program print? a = "hi" b = 4 c = a * b print(type(c)), A. <class 'str'>, B. <class 'int'>, C. <class 'float'>, The program crashes., Suppose you have a variable defined as: a = "4" a = "4" What is the variable type of a?, str, int, float, number, Choose the option that correctly prints out the variable(s)., x = "codehs"print(int(x)), num = 8\nprint("num"), name = "Alyx"\nage = 32\nprint(name + "is " + age), language = "Python"\nprint("I'm learning " + language), What kind of data does a float variable contain?, Whole numbers, Words, Numbers with decimal components, A float is not a Python variable type, What does the following code print? x = 3.4 y = 1 print(int(x)) print(x + y), 3.4\n4.4, 3\n4.4, 3\n4, The code causes an error, Which is the best way to get a number from the user for a mathematical equation?, num = str(input("Enter a number: ")), num = number(input("Enter a number: ")), num = input("Enter a number: "), num = int(input("Enter a number: ")), What is the final result of the expression 2**3?, 6, 8, 2, Invalid Python expression, What character do Python comments begin with?, #, %, -, ", What is the difference between a binary operator and a unary operator?, Computers can use binary operators, but not unary operators., A unary operator needs two things, while a binary operator needs one., A binary operator needs two things, while a unary operator needs one., Binary operators are for arithmetic, unary operators are for strings., On which line will Python produce an error? weight = input("How much do you weigh? ") oz_water = weight / 2 print("You should drink " + str(oz_water)) print("ounces of water every day if you weigh " + weight), Line 1, Line 2, Line 3, Line 4, In what order should these statements be executed? A) response = input("Do you like cheese? ") B) print("You have chosen " + confirm) C) print("You responded " + response) D) confirm = input("Are you sure? "), A, B, C, D, B, C, A, D, A, C, D,B, C, B, A, D, What is the output of the following program if the user enters "Florence" and "Fernandez"? first_name = input("What is your first name? ") last_name = input("What is your last name? ") whole_name = first_name + last_name print(whole_name), Fernandez Florence, Florence\nFernandez, FlorenceFernandez, Florence Fernandez, Which is a properly formed Python variable name?, user_age, uSeRaGe, user!age!, 1user_age, Which of the following is NOT a Python variable type?, int, str, float, number, Choose the correct declaration of a float variable with the value 3.14., pi = "3.14", pi = int(3.14), pi = 3.14, float pi = 3.14.
0%
Python Basics Multiple Choice Questions
Share
Share
Share
by
Gulnaztor
I-edit ang Content
I-Print kini
Embed
Uban pa
Assignments
Leaderboard
Show more
Show less
Kini nga leaderboard naka-pribado. Pag-klik sa
Share
aron himuon kini nga publiko.
Kini nga leaderboard gi-disable sa tag-iya sa resource.
Kini nga leaderboard gi-disable tungod ang imong mga kapilian lahi ra sa tag-iya sa resource.
I-revert ang mga Kapilian
Ang
Quiz
usa ka open-ended nga template. Dili kini makamugna ug mga marka sa leaderboard.
Kinahanglan mag log in
Visual style
Fonts
Subscription required
Mga Option
AI Enhanced: This activity contains content generated by AI.
Learn more.
I-switch ang template
Ipakita tanan
Daghang mga format ang mugawas samtang gidula nimo ang activity.
)
Open results
Copy link
QR code
Mag-delete
I-restore ang gi-autosave:
?