-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
49 lines (32 loc) · 1.21 KB
/
app.py
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
38
39
40
41
42
43
44
45
46
# sentence = input("Please enter your sentence : ")
# word_toberemoved = input ("Please enter a word you want to replace : ")
# word_tobeadded = input("Please enter the new word :")
# new_sentence = sentence.replace(word_toberemoved,word_tobeadded)
# print(f'Your new re-encarnated sentence is :{new_sentence}')
# 2D lists
# mylist = [
# [1,2,3],
# [6,4,6],
# [9,0,8]
# ]
# print(mylist[0][1])
# Try and exception :
# try:
# name = str(input("Please enter a name : "))
# sentence = int(input("Please input an integer value : "))
# print(sentence)
# print(name)
# except ValueError:
# print("The value is not an Integer")
# except NameError :
# print(" 'name' variable is not defined ")
# finally:
# print("Try and catch is been executed ... Good going kiddo ")
# -----> How to read a file in python <------
# readfile = open('C:/Users/sarve/OneDrive/Desktop/practice/.vscode/Naruto.txt','r')
# readfile2 = open('C:/Users/sarve/OneDrive/Desktop/practice/.vscode/Hakai.txt','r')
# for jango in readfile.readlines():
# for mango in readfile2.readlines():
# for(i= 0 , i<len(jango) , i= i+1): # The error is here
# print(jango + mango)
# readfile.close()