0% found this document useful (0 votes)
3 views1 page

Python Homework

The document outlines a Python homework assignment consisting of three parts: printing statements, working with variables, and using if statements. It includes specific tasks such as printing a name, creating variables, and implementing conditional logic. Additionally, there is a bonus challenge involving age and name variables.

Uploaded by

alsyedahmed309
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)
3 views1 page

Python Homework

The document outlines a Python homework assignment consisting of three parts: printing statements, working with variables, and using if statements. It includes specific tasks such as printing a name, creating variables, and implementing conditional logic. Additionally, there is a bonus challenge involving age and name variables.

Uploaded by

alsyedahmed309
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 Homework: Print, Variables, and If

Statements

Part 1: Print
1. Print your full name.
2. Print the sentence: Python is fun!
3. Print the number 50 and the word 'points' on the same line.

Part 2: Variables
4. Create a variable city with the value 'Cairo' and print it.
5. Create two variables a = 7 and b = 3. Print their product (multiplication).
6. Assign 'football' to a variable called hobby. Print: My hobby is football

Part 3: If Statements
7. Create a variable x = 12. If x is greater than 10, print 'x is large'.
8. Create a variable score = 40. If score is greater than or equal to 50, print 'Pass'. Otherwise, print
'Fail'.
9. Create a variable temperature = 25. If it is less than 20, print 'Cold'. Otherwise, print 'Warm'.

Bonus Challenge ■
10. Create two variables age = 16 and name = 'Ahmed'. If age is 18 or more, print 'Ahmed is an
adult.'. Otherwise, print 'Ahmed is young.'

You might also like