close
The Wayback Machine - https://web.archive.org/web/20250329175322/https://www.geeksforgeeks.org/quizzes/python-fundamentals/

Python Fundamentals

In this quiz we are going to practice questions to grasp python basics, variables, keywords and python operators.

Last Updated :
Discuss
Comments

Question 1

 Who developed Python Programming Language?

  • Rasmus Lerdorf

  • Wick van Rossum

  • Niene Stom

  • Guido van Rossum

Question 2

Which of the following is a valid way to comment in Python?

  • // This is a comment

  •  # This is a comment

  • <!-- This is a comment -->

  •  /* This is a comment */

Question 3

What is the result of the following expression in Python: 5 + 2 * 3

  • 21

  • 17

  • 11

  • 1

Question 4

What will be the output of the following code snippet?

Python
a = 5
b = 2
print(a // b)
  • 2.5
     

  • 2

  • 2.0

  • 2.00

Question 5

What is the output of the following code?

Python
num1 = "5"
num2 = 3
result = num1 * num2
print(result)
  • 15


     

  • "555"

  • 8

  • "333"

Question 6

What is the output of the following code?

Python
value = 2 + 3 * 4 / 2
print(value)
  • 4.5
     

  • 10.0

  • 8.0

  • 12.0

Question 7

What is the output of the following code?

Python
x = "5"
y = "2"
print(x + y)
  • 7
     

  • 52

  • 10

  • 3

Question 8

Which of the following statements is true about Python variables?

  • Variables must be declared before they are used.

  • Variables can contain only letters.

  • Python variables are case-sensitive.

  • Python variables cannot be reassigned.

Question 9

Which of the following is the correct way to take user input in Python?

  • input()
     

  • get_input()

  • user_input()

  • read_input() 

Question 10

Which of the following is the correct type conversion for converting a floating-point number to an integer in Python?

  • int(float_num)

  • integer(float_num)

  • float_to_int(float_num)

  • convert_int(float_num)

"This course is very well structured and easy to learn. Anyone with zero experience of data science, python or ML can learn from this. This course makes things so easy that anybody can learn on their own. It's helping me a lot. Thanks for creating such a great course."-  Ayushi Jain | Placed at Microsoft

Now's your chance to unlock high-earning job opportunities as a Data Scientist! Join our Complete Machine Learning & Data Science Program and get a 360-degree learning experience mentored by industry experts.

Get hands on practice with 40+ Industry Projects, regular doubt solving sessions, and much more. Register for the Program today!

There are 17 questions to complete.

Take a part in the ongoing discussion