Python Forum
just a trial. Please wait 5 minutes before deleting this thread
Thread Rating:
  • 3 Vote(s) - 3.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
just a trial. Please wait 5 minutes before deleting this thread
#1
my question here:just a trial

#file1.py
print("HANDLING LISTS")
L = [1.2, 5.6, 7.8]
L[1]= 8.9
for x in L:print(x, end=' ')
print()  # display a blank line
for x in L:print(x)
x = 'a'
y = 'b'
print('%s....%s' % (x, y))
print("CONSTRUCTION OF A LIST ELEMENT BY ELEMENT")
value=4.5
L=[]
L[:0]=[value]
for x in L:print(x)
value=3.5
L.append(value)
value=7.4
L.append(value)
value=9.4
L.append(value)
L.sort()
for x in L:print(x, end=' ')
print()
print("length of L=", len(L))
print(L)
print("AVERAGE OF THE VALUES OF A LIST")
L=[3.5, 4.5, 7.4, 9.4]
print(L)
print("length of L=", len(L))
sum=0
for x in L:
   sum=sum+x
   print(sum)


print("the sum of the whole is: ", sum)
average=sum/len(L)
print("The average value of the whole is: ", average)
exit()
Reply


Messages In This Thread
just a trial. Please wait 5 minutes before deleting this thread - by sylas - Jun-06-2017, 05:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Wait til a date and time KatManDEW 2 1,456 Mar-11-2022, 08:05 PM
Last Post: KatManDEW
  wait for the first of these events Skaperen 4 2,005 Mar-07-2022, 08:46 PM
Last Post: Gribouillis
  how to do a two-way wait Skaperen 2 1,285 Mar-04-2022, 02:31 AM
Last Post: Skaperen
  Run an app in a standalone terminal and wait until it's closed glestwid 2 2,548 Aug-30-2020, 08:14 AM
Last Post: glestwid
  python os.popen is not working for wait method elenaflorence87 0 2,013 Jul-22-2020, 12:56 PM
Last Post: elenaflorence87
  Wait for command within a process bRitch022 1 3,277 Jul-15-2020, 07:03 PM
Last Post: bRitch022
  Error SQLite objects created in a thread can only be used in that same thread. binhduonggttn 3 15,654 Jan-31-2020, 11:08 AM
Last Post: DeaD_EyE
  Could you help with this bug I have looked for like 20 minutes ryder5227 1 2,215 Sep-29-2019, 10:58 PM
Last Post: jefsummers
  Subprocess.send_signal, wait until completion plinio 5 9,102 Jun-29-2018, 12:07 PM
Last Post: plinio
  calculating the datetime objects to get the minutes chris0147 1 2,941 Apr-04-2018, 12:04 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020