Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,836 members, 7,817,454 topics. Date: Saturday, 04 May 2024 at 12:34 PM

Urgent Help Needed On This Assignment - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Urgent Help Needed On This Assignment (494 Views)

Hi Guys, Please Help With This Assignment / Please Help Me With This Assignment / Hello Programmers, Please I Need You Help With This Assignment (2) (3) (4)

(1) (Reply) (Go Down)

Urgent Help Needed On This Assignment by Buskynwa: 8:38pm On Nov 09, 2022
Any help to solve this will be appreciated, a little token will be giving to the person for a job well done

Re: Urgent Help Needed On This Assignment by airsaylongcome: 9:28pm On Nov 09, 2022
Show what you have done so far
Re: Urgent Help Needed On This Assignment by tangoalpharomeo: 10:36pm On Nov 09, 2022
As a programmer, you will spend your entire career using frameworks, libraries and applications that were written by other programmers, so you should know how to read the docs.

I won't just give you the answer. I also won't assume that you were trying to be lazy. But what I will assume is that you don't know how to get to the python docs.

So here's the link: [a]docs.python.org[/a]. Good luck.
Re: Urgent Help Needed On This Assignment by chukwuebuka65(m): 11:15pm On Nov 09, 2022
Very simple. You should be able to solve this on your own.
Re: Urgent Help Needed On This Assignment by ZiiVentures: 5:55am On Nov 10, 2022
Very simple bro
Re: Urgent Help Needed On This Assignment by ZiiVentures: 6:00am On Nov 10, 2022
For number 1:


sum = 0

for i in range(1, 51):
sum += i

print("the sum is: ", sum)


Indent properly
Re: Urgent Help Needed On This Assignment by TastyFriedPussy: 6:47am On Nov 10, 2022
ZiiVentures:
For number 1:


sum = 0

for i in range(1, 51):
sum += i

print("the sum is: ", sum)


Indent properly
baba, {i} should be less than 51 naa undecided
Re: Urgent Help Needed On This Assignment by Najdorf: 7:28am On Nov 10, 2022
Just Google bro. How exactly do you want to progress in life when you want everything spoon-fed to you ?
Re: Urgent Help Needed On This Assignment by ZiiVentures: 8:20am On Nov 10, 2022
TastyFriedPussy:
baba, {i} should be less than 51 naa undecided

According to python, an iteration of n evaluates from 0 to n - 1.

So when you write:

for n in range(10):
print(n)

It will print 0 - 9

Likewise when you write:

for n in range(1, 10):
print(n)

It will print 1 - 9
Re: Urgent Help Needed On This Assignment by tope6217: 8:47am On Nov 10, 2022
Drop money make I help
Re: Urgent Help Needed On This Assignment by LikeAking: 6:49pm On Nov 10, 2022
ZiiVentures:
For number 1:


sum = 0

for i in range(1, 51):
sum += i

print("the sum is: ", sum)


Indent properly



Stop giving ans here.

U are not helping him..

He shud figure out..

1 Like

Re: Urgent Help Needed On This Assignment by airsaylongcome: 8:24pm On Nov 10, 2022
ZiiVentures:


According to python, an iteration of n evaluates from 0 to n - 1.

So when you write:

for n in range(10):
print(n)

It will print 0 - 9

Likewise when you write:

for n in range(1, 10):
print(n)

It will print 1 - 9

Given what you have stated, should your loop not be from 2 to 52?

And while I know you are trying to help the OP, it's not a good idea to share an answer without seeing what the OP has attempted. You help them learn that way rather than spoon feeding them
Re: Urgent Help Needed On This Assignment by ZiiVentures: 8:43pm On Nov 10, 2022
airsaylongcome:


Given what you have stated, should your loop not be from 2 to 52?

And while I know you are trying to help the OP, it's not a good idea to share an answer without seeing what the OP has attempted. You help them learn that way rather than spoon feeding them

No. Bro. My loop will run from 1 to 50.

Secondly, I'm not spoon feeding him. I only solved the first question to motivate him to solve the other two.

1 Like

Re: Urgent Help Needed On This Assignment by ChilamNk(m): 9:54pm On Nov 10, 2022
Each person with their own challenge grin

Abeg I am about to buy this laptop at 75k... Make una help review if it ok?

HP ProBook 645 G2 - 6th Gen. AMD A8 - 256GB SSD - 8GB RAM - 4GB Total Graphics - 0.5GB Dedicated ,
Battery life is 2 hours but I have acess to steady light
Re: Urgent Help Needed On This Assignment by eventainment(m): 1:11am On Nov 11, 2022
Class Hi:
Pass
Class Hello(HI):
Pass

This is class inheritance
Re: Urgent Help Needed On This Assignment by eventainment(m): 1:13am On Nov 11, 2022
import random


quiz = [ {"Question" : "how many elements are in the periodic table?",
"a" : "150",
"b" : "200",
"c" : "118",
"d" : "250",
 "Answer" : "c"} , 

{"Question" : "what company was originally called 'cadabra'?",
"a" : "Facebook",
"b" : "Apple inc.",
"c" : "Blackrock",
"d" : "Amazon",
 "Answer" : "d"},

{"Question" : "what planet has the most moons?",
"a" : "jupiter",
"b" : "saturn",
"c" : "mars",
"d" : "earth",
 "Answer" : "b"},

{"Question" : "who is the current president of Nigeria?",
"a": "M. buhari",
"b" : "Peter Obi",
"c" : "Atiku A.",
"d" : "Tinibu(jagaban)",
 "Answer" : "a"},

{"Question" : "who founded facebook?",
"a" : "Steve Jobs",
"b" : "Mikel Obi",
"c" : "Mark Zuckerberg",
"d" : "Buhari",
 "Answer" : "c"} ]


quizunmber : list = len(quiz)
correctAnswer : int = 0


number = 0
random.shuffle(quiz)
correction: list = []

for n in quiz:
    A = n["Question"]
    number += 1
   
    print(f'Question {number} : {A}')
    print(f'a: {n["a"]}')
    print(f'b: {n["b"]}')
    print(f'c: {n["c"]}')
    print(f'd: {n["d"]}')
    inputAns = (input(f'answer >' )).lower()

    if inputAns == "a" or inputAns == "b" or inputAns == "c" or inputAns == "d":


        if n["Answer"] == inputAns:
            correctAnswer = correctAnswer + 1
            print(correctAnswer)

            print('\n answer is correct \n')
        else: 
            print("\n incorrect answer \n"wink

            correction.append({"question": n["Question"],
            "Answer" : n[ n["Answer"]]})

    else:
        print("wrong input"wink
    
print(f'you got {correctAnswer} out of {quizunmber}')

if correction:
        print("correction"wink if len(correction) <= 1 else print("correction"wink
        print(correction)

(1) (Reply)

Starting My Alx Journey / Remita Api Integration With Django / Are You Looking For Ios App Development Company ?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 23
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.