Python Forum
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
very new to python
#1
I need to convert a pretty big block of Psuedo Code into Python Code. Could someone give me a hand?

I've been given this to start with:
Flaptime =0
slaptime =0
total =0
average = 0.0
i = 0
isTired = False

while i<64 and isTired == False:
    # insert you solution below 
and the Psuedo Code is this:
Flaptime =0
slaptime =0
total =0
average = 0.0

i = 0
isTired = False

while i<64 and isTired == False
  input laptime
  total = total + laptime
  if i == 0
    Flaptime = laptime
    Slaptime = laptime
  end if 
  
  if laptime < Flaptime then
    Flaptime = laptime
  else if laptime > Slaptime then
    Slaptime = laptime
    end if 
  input isTired
end while

average = total /i
output ("the total time is " &total & "average " &average & "Fastest time "
&Flaptime & "slowest time is "&Slaptime )
I'm not the wisest at this, and I'm struggling quite a bit. I'd really appreciate a hand
Reply
#2
What have you tried? We're not going to write your code for you, but we would be glad to help you fix your code when you run into problems.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
(Jan-13-2019, 04:35 PM)ichabod801 Wrote: What have you tried? We're not going to write your code for you, but we would be glad to help you fix your code when you run into problems.

Man, I have to be honest with you. I only started coding a few weeks ago and I don't get it pretty much at all. I only need to convert this code but I have no clue how to start. I get that you dont wanna do it for me, but I really dont know what to do.
Reply
#4
If you're not sure what to do, start small. If you feel like you haven't learned anything, try learning it a different way - there are lots of written tutorials and Youtube videos that can help. If you're past that, start as small as you can. If you're not sure what the single next line to write should be, explain as much as possible your thought process, what is confusing, or what you tried.
Reply


Forum Jump:

User Panel Messages

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