0% found this document useful (0 votes)
12 views2 pages

Assignment 123123

Uploaded by

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

Assignment 123123

Uploaded by

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

1 Introduction to Computer Science and Engineering

GV: Trần Thị Mỹ Tiên

CHAPTER 4: PROGRAMMING
ASSIGNMENT 2: BUILT-IN FUNCTIONS
1. Write a program that asks the user to enter their age
in years as input (assume that the user enters a
positive integer) and calculates and prints how old
the user is in terms of days. Assume that there are
365 days in a year.
For example: if the user enters 22
Sample Output  You are 8030 days old
2. Write a program that asks the user to enter two float
numbers and display output in following format:
Sample Output:
a b a+b a-b a*b a/b sqrt(a)
5.5 4.0 9.5 1.5 22.0 1.38 2.345
3. Write a Python program to display the current date
and time.
Sample Output:
Current date and time
Tuesday, 23/10/2019, 13:15:20

4. Write a program to find the volume of a rectangular


prism.
2 Introduction to Computer Science and Engineering

GV: Trần Thị Mỹ Tiên


5. Write a Python program which accepts a list of
comma-separated integer numbers from user and
display length, sum of items in list.
6. Compose a program that writes five uniform random
floats between 0 and 1, their average value, and their
minimum and maximum value.

You might also like