#πŸ”’ Helpnke please

131 messages Β· Page 1 of 1 (latest)

gritty crow
#

Always marks comes 0

wild houndBOT
#

@gritty crow

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

gritty crow
#
#inputs
name = input("What is your name?: ")
pp = input("enter the password of today:")
#asking to enter password
if pp == "quiz":
  print("___password correct___")
  print("-"*42)
  print("\t\t\t You are welcome",name)
  print("-"*42)
  #writing questions
  input(print("1. What is the capital of India?"))
  ans=input
  if ans=="delhi":
    totalmarks = totalmarks + 1
  input(print("2. What is the capital of UAE?"))
  if ans=="abu dhabi":
    totalmarks = totalmarks + 1
  input(print("3. What is the capital of Pakistan?"))
  if ans=="islamabad":
    totalmarks = totalmarks + 1
  input(print("4. What is the capital of Bangladesh?"))
  if ans=="dhaka":
    totalmarks = totalmarks + 1
  input(print("5. What is the capital of Sri Lanka?"))
  if ans=="colombo":
    totalmarks = totalmarks + 1
  input(print("6. What is the capital of Nepal?"))
  if ans=="kathmandu":
    totalmarks = totalmarks + 1
  input(print("7. What is the capital of Bhutan?"))
  if ans=="thimphu":
    totalmarks = totalmarks + 1
  input(print("8. What is the capital of Maldives?"))
  if ans=="malΓ©":
    totalmarks = totalmarks + 1
  input(print("9. What is the capital of Mongolia?"))
  if ans=="ulaanbaatar":
    totalmarks = totalmarks + 1
  input(print("10. What is the capital of Thailand?"))
  if ans=="bangkok":
    totalmarks = totalmarks + 1
    #marks
    print("_"*42)
    print(totalmarks,name,"you            got",totalmarks,"out of 10")
    print("_"*42)
    #if password is incorrect
else:
  print(name,"sorry you are not allowed to enter")
  print("___password incorrect___")```
wild houndBOT
#

Hey @gritty crow!

It looks like you pasted Python code without syntax highlighting.

Please use syntax highlighting to improve the legibility of your code and make it easier for us to help you.

To do this, use the following method:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
gritty crow
#

See

frozen turtle
#

wat

gritty crow
#

Problem is that none also

frozen turtle
#

WHAT IS THE PROBLEM?

gritty crow
#

This none

frozen turtle
#

here

#
input(print("1. What is the capital of India?"))
  ans=input
#

what were you thinking

#
  ans=input("1. What is the capital of India?")
#

you don't put print inside input

#

and you don't just set ans to input

late stag
frozen turtle
#

for no reason

frozen turtle
gritty crow
#

so change it in all?

late stag
late stag
gritty crow
#

yes i want ans from user

frozen turtle
late stag
#

so that user input needs to be saved

frozen turtle
#

because if you just put input it doesn't update the value of ans

late stag
#

and you do that with input as @frozen turtle shows here

#

print is another way to show text on the screen, but it can only be used for that

gritty crow
#

yes because agent q told

late stag
#

you cant mix it with input or any other python fuction, because print will always return None when you use it

gritty crow
frozen turtle
#

also for the last if statement

if ans=="bangkok":
    totalmarks = totalmarks + 1
    #marks
    print("_"*42)
    print(totalmarks,name,"you            got",totalmarks,"out of 10")
    print("_"*42)

you put the code for displaying the total marks inside the if statement
which would only display the score if the user got the last question correct

#

so this would be correct

if ans=="bangkok":
    totalmarks = totalmarks + 1
    #marks
  print("_"*42)
  print(totalmarks,name,"you            got",totalmarks,"out of 10")
  print("_"*42)
gritty crow
#

ok

gritty crow
#

??

late stag
#

yes, None comes for using print

#

so removing print solves this

frozen turtle
#

because input prints out the value of print("text here")

#

that print statement returns None

gritty crow
#

Ok

gritty crow
#

tell?

late stag
#

share the code

frozen turtle
gritty crow
#
  ans=input
  if ans=="delhi":
    totalmarks = totalmarks + 1
  ans=input(print("2. What is the capital of UAE?"))
  if ans=="abu dhabi":
    totalmarks = totalmarks + 1```
wild houndBOT
#

Hey @gritty crow!

It looks like you pasted Python code without syntax highlighting.

Please use syntax highlighting to improve the legibility of your code and make it easier for us to help you.

To do this, use the following method:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
gritty crow
#

see

#

?

late stag
#

paste the real code you are running please

gritty crow
#

Wait

late stag
#

sure ill wait, you can also use our paste service if that is easier then discord code blocks

#

!paste

wild houndBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

gritty crow
#
#inputs
name = input("What is your name?: ")
pp = input("enter the password of today:")
#asking to enter password
if pp == "quiz":
  print("___password correct___")
  print("-"*42)
  print("\t\t\t You are welcome",name)
  print("-"*42)
  #writing questions
  ans=input(print("1. What is the capital of India?"))
  ans=input
  if ans=="delhi":
    totalmarks = totalmarks + 1
  ans=input(print("2. What is the capital of UAE?"))
  if ans=="abu dhabi":
    totalmarks = totalmarks + 1
  ans=input(print("3. What is the capital of Pakistan?"))
  if ans=="islamabad":
    totalmarks = totalmarks + 1
  ans=input(print("4. What is the capital of Bangladesh?"))
  if ans=="dhaka":
    totalmarks = totalmarks + 1
  ans=input(print("5. What is the capital of Sri Lanka?"))
  if ans=="colombo":
    totalmarks = totalmarks + 1
  ans=input(print("6. What is the capital of Nepal?"))
  if ans=="kathmandu":
    totalmarks = totalmarks + 1
  ans=input(print("7. What is the capital of Bhutan?"))
  if ans=="thimphu":
    totalmarks = totalmarks + 1
  ans=input(print("8. What is the capital of Maldives?"))
  if ans=="malΓ©":
    totalmarks = totalmarks + 1
  ans=input(print("9. What is the capital of Mongolia?"))
  if ans=="ulaanbaatar":
    totalmarks = totalmarks + 1
  ans=input(print("10. What is the capital of Thailand?"))
  if ans=="bangkok":
    totalmarks = totalmarks + 1
    #marks
  print("_"*42)
  print(totalmarks,name,"you            got",totalmarks,"out of 10")
  print("_"*42)
    #if password is incorrect
else:
  print(name,"sorry you are not allowed to enter")
  print("___password incorrect___")```
wild houndBOT
#

Hey @gritty crow!

It looks like you pasted Python code without syntax highlighting.

Please use syntax highlighting to improve the legibility of your code and make it easier for us to help you.

To do this, use the following method:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
gritty crow
#

!paste

wild houndBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

late stag
#

noticce the tags that come up, read them please, it contains information to you πŸ˜„

#

ans=input what does this line do?

gritty crow
#

means?

frozen turtle
#

so here, in your code

late stag
frozen turtle
#

you didn't remove the print

gritty crow
#

What i dont understood

late stag
gritty crow
#

what shoud i do?

late stag
#

what did i write you should do?

gritty crow
#

Sorry i forgot i need to remove print?

#

yes?

late stag
#

yes, tell me what print is used for?

gritty crow
#

to print question

late stag
#

it is used to print text on the screen

#

you cant mix it with input

#

input already does that

gritty crow
#

Oooh

late stag
#

you can split in in two lines

gritty crow
#

A dumb mistake

#

slrry

late stag
#

or just use input on its own

gritty crow
#

thanks

late stag
#

do you know what a dictionary is?

gritty crow
#

no

#

what it is?

late stag
#

then dont worry about it

#

there are many tools to help you write code

gritty crow
#

i know i am new so i wrote whith my knowledge

late stag
#

so instead of writing 100 lines of code, it can be done in... well... 5 lines

late stag
gritty crow
#

πŸ™ƒ

#

i will learn thanks for your help i am working on this for 3 days and now it is complcted because is ha many errors

#

which i asked here

late stag
#

hope you managed to sort it out! you can come back anytime you want

gritty crow
#

ok

#

1 more error

#

1 last error

late stag
#

always share errors

gritty crow
#

in terminal i have 0 marks

#

when i even wrote correct ans

frozen turtle
gritty crow
#

that only

ripe gazelle
#

I thought I helped you fixed this @gritty crow ?

gritty crow
#

No

late stag
#

always share errors

gritty crow
#

Coming again

late stag
#

always share code

gritty crow
#
#inputs
name = input("What is your name?: ")
pp = input("enter the password of today:")
#asking to enter password
if pp == "quiz":
  print("___password correct___")
  print("-"*42)
  print("\t\t\t You are welcome",name)
  print("-"*42)
  #writing questions
  ans=input("1. What is the capital of India?")
  ans=input
  if ans=="delhi":
    totalmarks = totalmarks + 1
  ans=input("2. What is the capital of UAE?")
  if ans=="abu dhabi":
    totalmarks = totalmarks + 1
  ans=input("3. What is the capital of Pakistan?")
  if ans=="islamabad":
    totalmarks = totalmarks + 1
  ans=input("4. What is the capital of Bangladesh?")
  if ans=="dhaka":
    totalmarks = totalmarks + 1
  ans=input("5. What is the capital of Sri Lanka?")
  if ans=="colombo":
    totalmarks = totalmarks + 1
  ans=input("6. What is the capital of Nepal?")
  if ans=="kathmandu":
    totalmarks = totalmarks + 1
  ans=input("7. What is the capital of Bhutan?")
  if ans=="thimphu":
    totalmarks = totalmarks + 1
  ans=input("8. What is the capital of Maldives?")
  if ans=="malΓ©":
    totalmarks = totalmarks + 1
  ans=input("9. What is the capital of Mongolia?")
  if ans=="ulaanbaatar":
    totalmarks = totalmarks + 1
  ans=input("10. What is the capital of Thailand?")
  if ans=="bangkok":
    totalmarks = totalmarks + 1
    #marks
  print("_"*42)
  print(totalmarks,name,"you            got",totalmarks,"out of 10")
  print("_"*42)
    #if password is incorrect
else:
  print(name,"sorry you are not allowed to enter")
  print("___password incorrect___")```
wild houndBOT
#

Hey @gritty crow!

It looks like you pasted Python code without syntax highlighting.

Please use syntax highlighting to improve the legibility of your code and make it easier for us to help you.

To do this, use the following method:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
ripe gazelle
gritty crow
#

ok

#

Yeah worked thanks my first project of code is finished

#

thanks

ripe gazelle
#

np

#

Type !close to close this thread

gritty crow
#

ok

#

One more question

#

(is there night now)

ripe gazelle
#

its night somewhere in the world

gritty crow
#

no in your area

ripe gazelle
#

yes. Why do you ask?

gritty crow
#

cuz here is day

ripe gazelle
#

Did you just discover timezones?

gritty crow
#

yes i am i was shocked you are onle at morning

#

!close

wild houndBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.