Repository navigation
Expand file tree
/
Copy pathprint.py
More file actions
37 lines (26 loc) · 1.62 KB
/
Copy pathprint.py
File metadata and controls
37 lines (26 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
print("Hello 500g of Flour" + "," + " 10g Yeast and 300ml Water in a bowl.")
print("Knead the dough for 10 minutes.")
print("Add 3g of Salt.")
print("Leave to rise for 3 hours.")
print("Bake at 200 degerees C for 30 minutes.")
###
print('She said: "Hello" and then left.') # use of ('') is permissible when there is a conflict of ("")
print ("She said: \"Hello\" and then left.") #use of (\"\") is a way in order to parse the double quote conflict within a double quote
print("Muhammad 'PBUH' is the prophet of the whole world")
print('The religion "Islam" is the truest religion of all time')
print("Allah is the greatest \"Allahuakbar\"")
###
#printing multiple lines in a single print statement
print("There is none worhty os worship except Allah!\nand Muhammad is the messenger of Allah")
# the above line denotes that within a string if wnat to continue in a new line we can make use of "\n" within a string.
###
print("Hello" + "Saad")
#As the output yeilds no space in between the printed string in order to add one we have to introduce a space which we can do by using the below print method
print("Hello" + " " + "Saad")
#Types of error
# An "IdentationError" generally means that there are some leading spaces in the beggining of your code which may result in the code not running and giving out specified error
# an "Syntaxerror: EOL while scanning string literal" generally means that there is an python syntax error associated with the code
print("Day 1 -" + " String Manipulation.")
print('String Concatenation is done with the "+" sign.')
print('e.g. print("Hello" + "world")')
print("New line can be created with a backslash and n.")