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

Python DataTypes Assignment Answers

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)
2 views2 pages

Python DataTypes Assignment Answers

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

Python Data Types Assignment - Answer Sheet

Answer 1
name='Maryam', age=16, height=1.65, is_student=True. Use type() to print str, int, float, bool.

Answer 2
name=input(...), age=int(input(...)); print greeting message.

Answer 3
x=int, y=float, z=str.

Answer 4
int('25') -> 25 (int), int(19.99) -> 19 (int).

Answer 5
Example: 'Maryam' (str), 16 (int), 1.65 (float), True (bool).

Answer 6
country=str, population=int, temperature=float, is_summer=bool.

Answer 7
'100' -> str, 100 -> int, 100.0 -> float, False -> bool.

Answer 8
int('18') -> 18, float('170.5') -> 170.5.

Answer 9
Print: My name is Ali Ahmed and I am 16 years old.

Answer 10
favorite_color is str. favorite_number is str unless converted.

Answer 11
type(x)=int, type(y)=str.
Answer 12
float(50)=50.0, str(50)='50'.

Answer 13
title=str, pages=int, rating=float, available=bool.

Answer 14
Replace true with True.

Answer 15
Student Profile with appropriate data types.

Challenge
Name=str, Age=int, Weight=float.

You might also like