-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.py
More file actions
135 lines (101 loc) · 2.67 KB
/
1.py
File metadata and controls
135 lines (101 loc) · 2.67 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
print("Hello world")
print("""Hello world""")
print('Hello world')
print('''Hello world''')
print("-------------------------------------")
print("JAI SHREE RAM")
print("-------------------------------------")
print("My name is ", end = ": ")
print("John")
print("my age is " , end = ": ")
print("26")
print("My name is ", end = ": ")
print("Adarsha")
print("my age is " , end = "\n")
print("26")
print("name:\tJohn")
print("Age:\t26")
name = "ADHARSHA S A"
print("Hello Mr. " + name + "")
name = "Ramanjini"
age = 22
print("My name is " + name + " and my age is " +str(age) + ".")
a = 10
print(type(a))
a = 20.5
print(type(a))
print("Enter your age")
age = input()
print("Enter your name")
name = input()
print("Age =", age)
print("Name =", name)
print(eval(input("Enter caluculations:")))
a = int(input("Enter your first Number"))
b = 3
sum = a + b
print("Sum of the two numbers is: ", sum)
name = "Ram"
print("My name is: "+name)
address = '''BTM,Bangalore,KARNATAKA'''
print("My address is : "+address)
str = "Welocome to KodNest Tech"
print("str: " + str)
print("char at index 0: " + str[0])
print("char at index 1: " + str[1])
print("char at index 2: " + str[2])
print("char at index 3: " + str[3])
print("char at index 4: " + str[4])
print("char at index 5: " + str[5])
print("char at index 6: " + str[6])
print("char at index 1: " + str[-1])
print("char at index 2: " + str[-2])
print("char at index 3: " + str[-3])
print(str[3:6])
print(str[0:6])
print(str[-13:7])
print(str[0:])
print(str[:7])
print(str[4:])
print(len(str))
print(str.upper())
print(str.lower())
print(str.find("KodNest"))
print(str.replace("Tech", "Technology"))
text = "Apple, Banana, Cherry, Orange, Mango"
a = text.split(",")
print(a)
joined_text = " - ".join(a)
print(joined_text)
a = "hello"
print(id(a))
print(a)
a = a.upper()
print(id(a))
print(a)
print("-------------------------------------")
print("JAI SHREE RAM")
print("-------------------------------------")
length = 6
width = 4
area = length * width
print("Area of rectangle is : ", area)
original_string = 'Immutable String'
modified_string = original_string.replace('I', 'i')
print("Original string:", original_string)
print("Modified string:", modified_string)
greeting = 'Good Morning'
new_greeting = greeting + ', John!'
print("Original greeting:", greeting)
print("Modified greeting:", new_greeting)
#user_name = input()
#user_age = int(input())
#print(f"Hello, {user_name}! You are {user_age} years old.")
N = int(input())
a = 10
b = 30
for i in range(N):
c = a + b
a = b
b = c
print(c ,end=" ")