Uploaded by Deyemi

Python Assignment 1

advertisement
SSG 215: Intro to Engineering Computing - ASSIGNMENT 1
Instructions
I.
II.
Create a folder with ONLY your matric number as the name of the folder
Save all your codes within the folder well numbered according to the question numbers
here e.g., Q1, Q2
III. There must NOT be any subfolder within the folder created in (I) above
IV. Zip your folder and forward as mail to mogundero@unilag.edu.ng on or before Monday,
18/12/23, 10:00pm
N.B: the mail subject should read in capital letters, “SSG215_ASSIGNMENT_1” ONLY. It is only
the zipped file attached that should have your matric number.
Python string concatenation Exercises
1) Hello World
A.
B.
C.
D.
Create a variable and store the text “Hello” in it
Create another variable and store the text “World” in it
Print: “HelloWorld” using string concatenation
Create another variable C and add the two variables together in C and print C
2) Tell me about yourself
A. Create a variable name and store your name inside it
B. Create another variable age and store your age there
C. Print: My name is name and I am age years old. (Using concatenation)
Note: Remember to convert the age variable to a string if not you’ll get a TYPE ERROR.
3) Contact Info
A.
B.
C.
D.
E.
F.
Sharing your contact info doesn’t have to be your actual info
Create a variable name and add a string with your name
Create a variable phoneno and add a phone number to it
Print: Contact Info
Print: Name: Your name
Print: Name: Your phone number
4) Password Generator
A.
B.
C.
D.
Ask user for their favourite colour
Ask user for their month of birth (The number)
Ask user for their pet’s name
Combine all these using string concatenation to form the password
e.g. (Bruno12blue or yellowgrumpy5
Download