0% found this document useful (0 votes)
29 views6 pages

Robotics & AI Revision Sheet T2 Answers

The document contains questions and answers related to data, information, and Python programming. It covers topics like the DIKW model, data types, operators, loops, functions, and more. Multiple choice, short answer and long answer questions are provided along with sample Python code snippets.

Uploaded by

kazuyapotterson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views6 pages

Robotics & AI Revision Sheet T2 Answers

The document contains questions and answers related to data, information, and Python programming. It covers topics like the DIKW model, data types, operators, loops, functions, and more. Multiple choice, short answer and long answer questions are provided along with sample Python code snippets.

Uploaded by

kazuyapotterson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Question 1:

(i) What does the DIKW model stand for?

● Correct option: (d) Data, Information, Knowledge, Wisdom

(iii) What would be the output for print(10+16) in Python?

● Correct option: (c) 26

(iv) Which of the following is a quantitative data?

● Correct option: (c) No. of items sold in a day

(v) A data type consisting of numbers, letters, and symbols.

● Correct option: (d) String

(vi) Which is the correct output for: for i in range(1,10): print(i)

● Correct option: (c) 1,2,3,4,5,6,7,8,9

Question 2:
(a) Joining elements together to make a string is called _________.

● Answer: Concatenation

(b) A _________ expression is an expression that is either true or false.

● Answer: Boolean

(c) The __________ acts as the brain of a robot.

● Answer: Central Processing Unit (CPU)

(d) A condition never becomes false in an _________ loop.

● Answer: Infinite
*(e) print(“hello”2) will give the output _______________.

● Answer: hellohello

Question 3: Short Answers


(a) What is the data footprint?

● Answer: The data footprint refers to the amount of data that is generated,
processed, and stored by a system or an organization. It represents the overall
impact of data in terms of storage space and resource utilization.

(b) What is a robot sensor? Give some examples.

● Answer: A robot sensor is a device that allows a robot to perceive its


environment. Examples include:
● Infrared sensors
● Ultrasonic sensors
● Touch sensors
● Camera sensors

(c) What are loops in Python? Give two examples.

● Answer: Loops in Python are used to execute a block of code repeatedly.


Examples include:
● For loop:

● python
● Copy code

for i in range(5):
print(i)


● While loop:

● python
● Copy code
count = 0
while count < 5:
print(count)
count += 1

(d) What is the purpose of the 'else' command?

● Answer: In Python, the 'else' statement is used in conjunction with 'if' statements
to specify a block of code that should be executed when the 'if' condition is false.

(e) Give the output of the following Python code:

python

Copy code

s = "python rocks"
print(s[7:11]*3)

● Answer: rocksrocksrocks

(f) What is the output of the expression, print(3*22)?**

● Answer: 12 (Explanation: 3 * (2^2) = 3 * 4 = 12)

(g) Why is data important? Give two examples.

● Answer: Data is important because it provides valuable information for


decision-making and analysis. Examples include:
● Business analytics using sales data
● Medical research using patient health records

(h) Describe two design aspects of a humanoid robot.

● Answer:
​ Ergonomics: Designing the robot to mimic human form for ease of
interaction and integration into human environments.
​ Sensory Systems: Incorporating advanced sensor systems to enable the
robot to perceive and respond to its surroundings.
Question 4: Long Answers

(i) HTML Structure


html

Copy code

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<!-- Content goes here -->
</body>
</html>

(ii) Python Programs


(a) Write a Python program to accept three integers from the user and print the largest
of the three.

python

Copy code

num1 = int(input("Enter first number: "))


num2 = int(input("Enter second number: "))
num3 = int(input("Enter third number: "))

max_num = max(num1, num2, num3)


print("The largest number is:", max_num)

(b) Write a Python program to take a starting and ending integer number from the user
and print the total of odd numbers between them.

python

Copy code

start = int(input("Enter the starting number: "))


end = int(input("Enter the ending number: "))

total = sum(x for x in range(start, end + 1) if x % 2 != 0)


print("The total of odd numbers between", start, "and", end, "is:", total)

(c) Write a Python program to take the side of a square and print the area and perimeter
of the square.

python

Copy code

side = float(input("Enter the side length of the square: "))

area = side ** 2
perimeter = 4 * side

print("The area of the square is:", area)


print("The perimeter of the square is:", perimeter)

(iii) Python Programs


(a) Write a Python program that takes marks of 5 subjects as input and prints the
average as output.

python

Copy code

marks = [float(input("Enter marks for subject {}: ".format(i + 1))) for i in


range(5)]

average = sum(marks) / len(marks)


print("The average marks are:", average)

(b) Write a Python program to print the following pattern:

python

Copy code

for i in range(1, 7):


for j in range(1, i + 1):
print(j, end="")
print()
(c) Write a Python program to print the following pattern using loops:

python

Copy code

for i in range(5):
for j in range(i + 1):
print(chr(65 + j), end=" ")
print()

(iv) Python Programs


(a) Write a Python program to create a dictionary of 5 fruits and their colors. Display the
dictionary items in the following pattern:

python

Copy code

fruits_colors = {
'Apple': 'Red',
'Banana': 'Yellow',
'Orange': 'Orange',
'Grapes': 'Purple',
'Watermelon': 'Green'
}

for fruit, color in fruits_colors.items():


print(f"{fruit} = {color}")

(b) Write the output of the following Python Program:

python

Copy code

x, y = 20, 60
y, x = x, y + 2
print(x + y)

● Answer: 82 (Explanation: x = 20, y = 62, so x +

You might also like