CSE110 Lab Assignment 1 - Data Types, Variables, and I - O
CSE110 Lab Assignment 1 - Data Types, Variables, and I - O
Jupyter Notebook:
Tutorial: https://www.youtube.com/watch?v=_GQd1jwH0A4
Google Colaboratory:
Link: https://colab.research.google.com/
Slack: https://join.slack.com/t/cse110summer2023/signup
buX:
https://bux-home.bracu.ac.bd/courses/course-v1:buX+CSE110+2023_Summer/abo
ut
Task 1
Write a Python program that prints "hello world" in a console.
hello world
Task 2
Write a Python program that prints the summation of 54 and 56. The program must use Python
operators and numbers but not use any variables.
110
Task 3
Write a Python program that assigns the values "Summer" and 2023 to variables `season` and
`year` respectively. Then, print the values of both variables in separate lines.
Summer
2023
Task 4
Write a Python program that reads the user's name and prints it back as shown in the examples
below.
2 2^3: 8
3
10 10^3: 1000
3
Task 6
A sailor has a boat known as Téssares Boat, which has four corners. The boat is capable of
carrying goods of any weight as long as there is equal distribution of loads on each corner of the
boat - the center area has been occupied by the engine. The sailor needs your help to know the
maximum amount of weight he can carry in each shipment.
Write a Python program that reads the total weight of the shipment and prints the maximum load
(or weight) the boat can take from the given shipment. We can assume that the weight of each
good is exactly 1 unit, therefore, the weight of 5 units means there are 5 (loose) items in the
shipment.
9 8
11 8
23 20
Task 7
Write a Python program that reads 3 integers A, B, and C respectively, and then reads a floating
point number D. After reading, the program should print the result (as int) using the given
formula below.
𝐶 𝐷
Formula110: 𝐴 +𝐵*𝐴− 3
2 267
6
8
1.3
9 907
100
1
3.7
88 2022
22
1
3.3
Task 8
Write a python program that takes an integer from the user which represents the number of
chocolates that he/she has. He/She decided to distribute the chocolates equally among 3 friends,
keeping the remaining chocolates for him/herself. Find out the number of chocolates each friend
will receive and the number of chocolates that will be remaining.
Sample Input 1:
50
Sample Output 1:
Sample Input 2:
90
Sample Output 2:
Task 9
Write a Python program that reads two values M and N from the user respectively and prints the
result by joining (concatenating) them in a bottom-up approach as shown in the following
example.
5 25
2
Hello WorldHello
World
Python 3Python
3
Task 10
Write a Python program that takes an integer, a float, and another integer number as input from
the user and prints the result as shown below. At first, add the first integer number to the float
and then concatenate the third input integer number.
7 False
0 True
-11 False
-26 True
Next lab
Branching