-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAllin.docx
More file actions
629 lines (484 loc) · 14.7 KB
/
Allin.docx
File metadata and controls
629 lines (484 loc) · 14.7 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
print("File destination is - cd c://python372 ")
print("File name is - py Allin.py")
print(("Hallow world"))
print("Mathematical operator order is - BEDMAS")
print("BEDMAS" "=" "Brackets, Exponents, Division, Multiplication, Addition, Subtraction")
print("left to right or left associative rule for * / - + operators")
print(("print(6-3+2) =") + str(6-3+2))
print(("print(6-3+2) =") + str(6-3+2))
print(("print(6-3+2) =") + str(6-3+2))
print(("print(6/3*2) =") + str(6/3*2))
print("left to right or left associative rule for * / - + operators")
#----------------------
print("but for ** right to left or right associative rule for * / - + operators")
print(("print(2**3**2) =") + str(2**3**2))
print(("2+3")+ "=" + str(2+3))
print(2+(3-1))
print("(2+(3-1))"+ "=" + str(2+(3-1)))
print(9/3)
print(("9/3")+ "=" + str(9/3))
print(9/3.0)
print(("9/3.0")+ "=" + str(9/3.0))
print(9.0/3)
print(("9.0/3")+ "=" + str(9.0/3))
print(9*3)
print(("9*3")+ "=" + str(9*3))
print(9.0*3)
print(9*3.0)
print(("9*3.0")+ "=" + str(9*3.0))
print((9-1+2)+(9/3*3))
print(("((9-1+2)+(9/3*3))")+ "=" + str((9-1+2)+(9/3*3)))
print(("(((-9)-1+2)+(9/3*(-3)))")+ "=" + str(((-9)-1+2)+(9/3*(-3))))
print((-9)*(-3))
print(("(-9)*(-3)")+ "=" + str((-9)*(-3)))
print(("(-9)/(-3)")+ "=" + str((-9)/(-3)))
print(("-9/-3")+ "=" + str(-9/-3))
print(("-9*-3")+ "=" + str(-9*-3))
print("idleAllin2.py")
print("================03-03-2019=====================04-03-2019=========\n==========================\n=====================")
print(("10/3")+ "=" + str(10/3))
print(("-10/3")+ "=" + str(-10/3))
print(("10/-3")+ "=" + str(10/-3))
print(9.73800000000)
print(("9.73800000000")+ "=" + str(9.73800000000))
print(("9.738043625475237500")+ "=" + str(9.738043625475237500))
print(("9.73804362547523750082364862865821")+ "=" + str(9.73804362547523750082364862865821))
print(("10**3")+ "=" + str(10**3))
print((" Quotient of " ) + ( " 10//3 ")+ " = " + str(10//3))
print((" Remainder of " ) + ( " 10%3 " )+ " = " + str(10%3))
A=14
B=40
print(""" IF input is A=14 and B=40 then,
modolous // and remainder % is """)
print("print(A//B) = " , A//B)
print("print(A%B) = " , (A%B))
print(("\"")+ "=" + str("\""))
print(("\""))
print("\"")
print(("Hallow world"))
print('Don\'t go there')
print("Don\'t go there")
print("Don't go there")
print('Don"t go there')
print("Don\"t go there")
print("Don\ t go there")
print("Don\t go there")
print(("Hallow\nworld"))
print(("Hallow \n world"))
print(("Hallow world"))
print(("Hallow""world"))
print(("Hallow"
"world"))
print("""Hallow"+
world""")
print("""Hallow"""
"""world""")
print("""Hallow
world""")
print("Hallow, world")
print("Concatenation")
print("2" + "3")
print("2.0" + "3.0")
print("Fun" * 3)
print("2" * 3)
print(("(\"Fun\" * 0)")+ "=" + str(("Fun" * 0)))
print("Fun" * 0)
print(("(\"9\" * 0)")+ "=" + str("9" * 0))
print("9" * 0)
print("New Start")
print("New Start at office on 04-03-2019 ============================================")
print(3*2)
print(3**2)
print(3+2)
print(("print(-12//12) =") + str(-12//12))
print(("print(12%11) =") + str(12%11))
print(("print(-12%11) =") + str(-12%11))
print(12%11)
print(-12%11)
x=len('hello')
print(x)
print("print(len('hello')) = " + str(len('hello')) )
print (" spam " + " egg ")
print ("spam," + " egg")
print ("spam'" + " egg")
print ("spam and egg")
print("start at home 04-03-2019========================")
print(3**2)
print(3.0**2)
print("(3**2)"+ "=" + str(3**2))
print("(3.0**2)"+ "=" + str(3.0**2))
print("(OK * 2)"+ "=" + str("OK" * 2))
print("(OK * 2 )"+ "=" + ("OK" * 2))
print("(OK * 2.0 )"+ "=" + ("Error"))
print("""print("(3**2)", "=" , str(3**2))""")
print("and / or")
print("""print("(3**2)"+ "=" + str(3**2))""")
print("will show")
print("(3**2)", "=" , str(3**2))
print(("(\"Fun\" * 0)")+ "=" + str(("Fun" * 0)))
print("Fun" * 0)
print(("(\"9\" * 0)")+ "=" + str("9" * 0))
print("9" * 0)
print(" The slice operators of strings")
print(" The slice operators of strings")
print(""" The slice operators, or indexing in python
starts from 0 """)
name = "12345 67890"
print(""" in name ='12345 67890' the blank space is also a character""")
print(name[0])
print(name[1])
print(name[3])
print(name[5])
print("print(name[0]) = ", (name[0]) )
print("print(name[1]) = ", (name[1]) )
print("print(name[3]) = ", (name[3]) )
print("print(name[5]) = ", (name[5]) )
print("print(name[4:9]) = ", (name[4:9]) )
print("print(name[4:]) = ", (name[4:]) )
print(""" The slice operators, or indexing in python
starts from 0
and the last index nuberd one is ignored """)
print(''' for printing a charecter to the
ignored ''')
print(" to printing a charecter, (5th to last) last character [4:] is used ")
random = 'abc def ghi jklm'
print(""" in the random = 'abc def ghi jklm' blank spaces
are also characters and are also indexed""")
print(random[0])
print(random[1])
print(random[3])
print(random[5])
print("print(random[0]) = ", (random[0]) )
print("print(random[1]) = ", (random[1]) )
print("print(random[3]) = ", (random[3]) )
print("print(random[5]) = ", (random[5]) )
print("print(random[0:5]) = ", (random[0:5]) )
print("print(random[3:7]) = ", (random[3:7]) )
print("print(random[3:]) = ", (random[3:]) )
print(" The slice operators, or indexing in python starts from 0 and the last index nuberd one is ignored ")
print(" to printing a charecter, from 4th to last to the last character [3:] is used ")
#----------
print("python loops or iterator with range():")
for i in range(5):
print(i)
for i in range(3):
print(i)
print("end of loop in loops")
print(" out of end of all loop ")
for i in range(1,4):
print(i)
print("end of loop in loops")
for i in range(1,2):
print(i)
print(" out of end of all loop ")
print("python loops or iterator")
print("python loops - for loop, and while loop")
name = "shyed"
for x in name:
print("Looping")
for x in name:
print(x)
name = "sssh"
for x in name:
print("Looping")
for x in name:
print(x)
for x in name:
print(" For the letter in the variable x is : " + x)
name = "3333"
for x in name:
print("22222")
for x in name:
print(x)
print(" For the letter in the variable x is : " + x)
name = "abcd"
for x in name:
print("12345 ")
for x in name:
print(x)
print(" For the letter in the variable x is : " + x)
print('end from outside of loop')
#------------
print("Variables")
x = 7
print(x)
print(x+5)
y=4
z=5
print(x+y+z)
x= "This is a string"
print(x + "!")
x= 'This is a string'
print("x" + "!")
lastname = 3
Lastname = 4
print(lastname + Lastname)
print("In place operators")
x=7
x+=2
print(x)
x-=3
print(x)
x*=4
print(x)
x/=2
print(x)
print("Booleans")
"Bruce" == "bruce"
print("Bruce" == "bruce")
my_bollean = True
print(my_bollean)
print("(2==3)"+ "=" + str(2==3))
print(2==3)
print("(\"Hellow\" == \"Hellow\")"+ "=" + str("Hellow" == "Hellow"))
print("Hellow" == "Hellow")
print("(\"Hellow\" == \"hellow\")"+ "=" + str("Hellow" == "hellow"))
print("Hellow" == "hellow")
print("(\"Hellow\" == \"Hollaw\")"+ "=" + str("Hellow" == "Hollaw"))
print("Hellow" == "Hollaw")
print(1!=3)
print(5!=5)
print("(5!=5)"+ "=" + str(5!=5))
print("(1!=3)"+ "=" + str(1!=3))
print("(5<=5)"+ "=" + str(5<=5))
print("(7>=5)"+ "=" + str(7>=5))
print("(1>3)"+ "=" + str(1>3))
print("(1<3)"+ "=" + str(1<3))
print("if statement")
print("if statement")
print("if statement")
print("if statement")
print('if 6>4:')
if 6>4:
print("true, 6 is greater than 4 ")
print('n=12')
n=12
if n>5:
print("n is greater than 5 ")
if n<=15:
print("n is less than 15 ")
print('if a=15')
a=15
if a == 11:
print('a!=11')
else :
print('a=15')
if 1+1 == 2:
if 2*2==8:
print('if')
else:
print('else')
print('out of the loop')
num = 7
if num >3:
print('>3')
else:
print('else')
if num==7:
print('==7')
print('out of the loop')
print('in the loop')
num = 7
if num >3:
print('>3')
else:
print('else')
if num==7:
print('==7')
print('in the loop')
esnum = 7
if esnum == 2:
print('esnum == 2')
else:
if esnum == 12:
print('esnum == 12')
else:
if esnum == 22:
print('esnum == 12')
else:
if esnum == 7:
print('esnum == 7')
print("elif")
print("elif")
elifsnum = 7
if elifsnum == 2:
print('esnum == 2')
elif elifsnum == 12:
print('esnum == 12')
elif elifsnum == 22:
print('elifsnum == 12')
elif elifsnum == 7:
print('elifsnum == 7')
print('Bollean logic')
print('Bollean logic')
print(2 == 2 and 3==3)
print(2 == 2 and 3==4)
print(2 == 2 or 3==4)
print(2 == 2 or 3==3)
print(not 2 == 2 )
print(not 2 != 2 )
print("with 'del' of the variable")
message = "what"
print(message)
del message
message = 'ff'
print(message)
print("with 'del' of the variable")
# print is a function
# mixing data types
print("data pypes int float string")
print("leave comments regularly and seriously")
print("There must not be spaces and dash - in the variable names")
name = " steafan "
age = 40
month = 4
print('print is a function')
print('mixing data types')
print(name)
print(name + "loves pizza")
print(age + month)
print("python loops or iterator")
print("python loops - for loop")
print(''' For the detail of for loop please go to -
forloop.py file''')
print('''declearing multiple variable \n values at a time and
multiple assignments of
same value to many variables in one line.''')
x1,x2,x3='r','y','b'
print(""" When x1,x2,x3='r','y','b' , then""")
print('print(x1, x2 ,x3) =', x1, x2 ,x3 )
print('print(x1+x2+x3) =', x1+x2+x3)
x1,x2,x3='r' +'y'+'b'
print(""" When x1,x2,x3='r' +'y'+'b' , then""")
print('print(x1, x2 ,x3) =', x1, x2 ,x3 )
print('print(x1+x2+x3) =', x1+x2+x3)
print(""" When y1,y2,y3=1 + 3 + 5, then this line will produce error, because
those values can not be assigned""")
y1,y2,y3=1,3,5
print(""" When y1,y2,y3=1,3,5 , then""")
print('print (y1+ y2+y3 )=' ,y1+ y2+y3 )
print('print( y1, y2,y3) =', y1, y2,y3)
z1,z2,z3='a',3.3,5
print(""" When z1,z2,z3='a',3.3,5 , then""")
print('print( z1,z2, z3) =', z1,z2, z3)
print('print( z1,z2+ z3) =', z1,z2+ z3)
print('print( z1+z2+ z3) =', '''' will produce error,
because strings can not be concatenate to int or floats''')
print(x1,x2,x3,y1,y2,y3,z1,z2,z3)
print('print(x1,x2,x3,y1,y2,y3,z1,z2,z3) =', x1,x2,x3,y1,y2,y3,z1,z2,z3)
print('print(x1+x2+x3+y1+ y2+y3+z1+z2+ z3) =', '''' will produce error,
because strings can not be concatenate to int or floats''')
print('print(x1,x2,x3, y1+y2+y3, z1,z2+z3) =', x1,x2,x3, y1+y2+y3, z1,z2+z3)
X=Y=Z='Apple'
print(''' When X=Y=Z= "Apple" , then''')
print('print(X,Y,Z) =', X,Y,Z )
print('print(X+Y+Z) =', X+Y+Z)
print("without 'del' of the variable")
message = "wwwww"
print(message)
message = 'ffff'
print(message)
print("without 'del' of the variable")
print("with 'del' of the variable")
message = "what"
print(message)
del message
message = 'ff'
print(message)
print("with 'del' of the variable")
print("without 'del' of the variable")
message = "wwwww"
print(message)
message = 'ffff'
print(message)
print("without 'del' of the variable")
print("python loops or iterator with range():")
for i in range(5):
print(i)
for i in range(3):
print(i)
print("end of loop in loops")
print(" out of end of all loop ")
for i in range(1,4):
print(i)
print("end of loop in loops")
for i in range(1,2):
print(i)
print(" out of end of all loop ")
n = input("please input your age")
print(float(n)/2)
print ("""entered value inside input function will
always get out as string""")
print("list or arrayes, arrayes are created by using []")
shoppinglist1="eggs, corrots, milk, apples"
print("shoppinglist1= eggs, corrots, milk, cherried, apples")
print('the above one is not a list data type of python')
shoppinglist2=['eggs', 'carrots', 'milk', 'cherries', 'apples']
print(" the list named - shoppinglist2=['eggs', 'carrots', 'milk', 'cherries', 'apples'] is created")
print('print(shoppinglist2[3]) =', shoppinglist2[3])
print('print(shoppinglist2[0]) =', shoppinglist2[0])
print(" can update all or can also update only one item in the list ")
shoppinglist2[3]= "mango milk"
print('print(shoppinglist2[3]) =', shoppinglist2[3])
print('print(shoppinglist2) =', shoppinglist2)
print("cherries was replaced by mango milk")
print(''' del function, can also delete an item by using del function
and after entering del shoppinglist2[1] the indexed 2nd item
will be deleated''')
del shoppinglist2[1]
print('print(shoppinglist2) =', shoppinglist2)
array1=[23,54.99,(64/2)]
array2=[43,23, 'nul']
array3=[3,4,9]
array4=array3+array1+array2
array5=array2+array1+array4
array6=(array5, array4)
print(array1)
print(array2)
print(""" array1=[23,54.99,(64/2)]
array2=[43,23, 'nul']
array3=[3,4,9]
array4=array3+array1+array2= """, array4,
"""\narray5=array2+array1+array4
= """ , array5 )
print('''array6=(array5, array4) =
''' , array6)
print('''array2=[43,23, 'nul'] =
''' , array2)
array7=['foo', 34, array1, array2 + array3 ]
print(''' array7=['foo', 34, array1, array2 + array3],
then print(array7) = ''' ,
array7)
# //"""-----------------------------------------------"""
#=========================================
print("foo")
foo=input("Pleae enter the value of foo: ")
print(foo)
print(float("210" * int(input("Enter a intiger number : "))))
float(input("Enter a number: ")) + float(input("Enter a number: "))
float(input("Enter a number fia: ")) + float(input("Enter a number fib: "))
print(float(input("Enter a number pfic1 : ")) + float(input("Enter a number pfic2 : ")))
print(int(input("Enter a number piic1 : ")) + int(input("Enter a number piic2 : ")))
input('To continue to the end of programm \n- Please Enter something :____ ')
print (input('To continue to the end of programm \n- Please Enter something :____ '))
print("import command packages")
print("import turtle command drawing package, there are many pakages")
import turtle
tut = turtle.pen()
tut = turtle.forward(200)
tut = turtle.left(200)
tut = turtle.forward(20)
tut = turtle.left(20)
tut = turtle.forward(120)
tut = turtle.right(20)
tut = turtle.forward(120)
tut = turtle.left(20)
tut = turtle.forward(120)
tut = turtle.right(20)
tut = turtle.forward(120)
tut = turtle.right(20)
tut = turtle.back(120)
tut= exit()
exit()
print(""" The End The End The End
The End ? """)