java and python begineers mcq with answers

https:/‮ual.www/‬tturi.com
java and python begineers mcq with answers

Here are a few multiple-choice questions (MCQs) that could be useful for beginners learning Java or Python:

Java

  1. Which of the following is a correct way to declare a variable in Java?

A. int x;
B. x = int;
C. int = x;
D. x: int;

Answer: A (int x;)

  1. Which of the following is not a valid Java data type?

A. int
B. float
C. double
D. string

Answer: D (string)

Python

  1. What is the output of the following Python code?
x = 5
y = 6
print(x + y)

A. 11
B. 5
C. 6
D. None of the above

Answer: A (11)

  1. Which of the following is not a valid Python data type?

A. int
B. float
C. double
D. tuple

Answer: C (double)

Created Time:2017-11-01 22:29:55  Author:lautturi