Documente Academic
Documente Profesional
Documente Cultură
1. Under what category of python can you group strings, lists and tuples ?
2. Create a string named subject and topic .
Assign the values Astrophysics, Galaxy
3.
4. Create a list named course with values Physics, Chemistry, Biology, Mathematics,
Commerce,Economics
5.
a.
Create an output statement Science students can opt for Biology or Mathematics
6.
Create a tuple myfriend with the name, age, hobby and address of your friend
7.
a.
My friend is
b.
He/she is
c.
He/she lives in
d.
years old
enjoys
8.
9.
10.
Write a command to add all the marks and find the total.
11.
12.
13.
Can you change the last value of marks from 310 to 330 ? Why ?
14.
Create a script named ex1.py using Input command accept First name, Last name and address of a
student with suitable prompts.
15.
b. You live in
16.
17.
18.
Name the function which you use to convert the input numbers into integers.
19.
When you join the string and the number you need to use the
function
20.
21.
In the above example when did you use the float() function ?
22.
23.
Input list as :
values = [0.9999999, 1, 2, 3]
Write the function to Sum values in list and store it in a variable add.
24.
Write a trunc function to truncate the value given in the variable value 1
value1 = 123.45
truncate1 = math.trunc(value1)
print(truncate1)
25.
Find the value of 2 raised to the power 3 using math.pow() method and also by using ** operator
26.
27.