-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDAclass1&2.txt
More file actions
149 lines (149 loc) · 3.19 KB
/
DAclass1&2.txt
File metadata and controls
149 lines (149 loc) · 3.19 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
Python 3.13.3 (tags/v3.13.3:6280bb5, Apr 8 2025, 14:47:33) [MSC v.1943 64 bit (AMD64)] on win32
Enter "help" below or click "Help" above for more information.
1+1
2
2+3
5
asma
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
asma
NameError: name 'asma' is not defined
name=asma
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
name=asma
NameError: name 'asma' is not defined
name='asma'
hname='jaffer'
sname='ayman'
dname='zoya'
name
'asma'
hname
'jaffer'
dname
'zoya'
apple=20
apple
20
banana=30
apple+banana
50
apple=100
apple+banana
130
asma
Traceback (most recent call last):
File "<pyshell#17>", line 1, in <module>
asma
NameError: name 'asma' is not defined
fam='i love my family."
SyntaxError: unterminated string literal (detected at line 1)
fam="i love my family.'
SyntaxError: unterminated string literal (detected at line 1)
fam='i love my family.'
fam
'i love my family.'
-asma
Traceback (most recent call last):
File "<pyshell#22>", line 1, in <module>
-asma
NameError: name 'asma' is not defined
asma
Traceback (most recent call last):
File "<pyshell#23>", line 1, in <module>
asma
NameError: name 'asma' is not defined
name
'asma'
#this is an commenting symbol
#this is an commenting symbol, this wont be run or compiled.
input()
"asma is a bad go\irl, hdfsbdfjdkhk, sbgjn"
'"asma is a bad go\\irl, hdfsbdfjdkhk, sbgjn"'
#remember, no need of quotes to input(), it gives o/p with single quotes
asma is a bad go\irl, hdfsbdfjdkhk, sbgjn
SyntaxError: invalid syntax
input()
asma is a bad go\irl, hdfsbdfjdkhk, sbgjn
'asma is a bad go\\irl, hdfsbdfjdkhk, sbgjn'
input()
a b c d f g ghhg
'a b c d f g ghhg'
input()
input(>>>)
'input(>>>)'
input(>>>)
SyntaxError: invalid syntax
input('--')
--hhhh
'hhhh'
input('asma')
asmashaik
'shaik'
input('asma')
asmashaik
'shaik'
input('asma')
asma
''
what should i enter
SyntaxError: invalid syntax
#what should i enter
input('what should i enter')
what should i enter
''
input('enter your math marks : ')
enter your math marks : 90
'90'
input('enter your eng marks : ')
enter your eng marks : 85
'85'
Maths=input('enter your math marks : ')
enter your math marks : 90
maths
Traceback (most recent call last):
File "<pyshell#44>", line 1, in <module>
maths
NameError: name 'maths' is not defined. Did you mean: 'Maths'?
Maths
'90'
Eng=input('enter your eng marks : ')
enter your eng marks : 85
Eng
'85'
Sci=input('enter your sci marks : ')
enter your sci marks : 88
Sci
'88'
Total=Eng+Maths+Sci
Total
'859088'
Total=Eng+ Maths+ Sci
Total
'859088'
Eng+ Maths+ Sci
'859088'
Eng+Maths+Sci
'859088'
#here is the error, we can do this by concatinating only. we cant add like this. later we learn abt concat function
input(--)
SyntaxError: invalid syntax
input()
1.11
'1.11'
input()
a bbbbb bnjdshkk
'a bbbbb bnjdshkk'
type(1111)
<class 'int'>
type(abcd)
Traceback (most recent call last):
File "<pyshell#61>", line 1, in <module>
type(abcd)
NameError: name 'abcd' is not defined
type('abcdfg')
<class 'str'>
type('input()')
<class 'str'>