#π Helpnke please
131 messages Β· Page 1 of 1 (latest)
@gritty crow
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.
#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___")```
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.
See
wat
WHAT IS THE PROBLEM?
This none
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
remember to be friendly and nice
for no reason
yea yea I'm just not very nice today
so change it in all?
take a break and i can continue
you want to take user input?
yes i want ans from user
change all the other questions to this format
ans=input("2. What is the capital of UAE?")
so that user input needs to be saved
because if you just put input it doesn't update the value of ans
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
yes because agent q told
you cant mix it with input or any other python fuction, because print will always return None when you use it
this is solution
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)
yes for fixing that i seprated it
ok
bus fhat none can be fixed with this
??
because input prints out the value of print("text here")
that print statement returns None
Ok
done this but still come none
tell?
share the code
gimme your code rn
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```
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.
paste the real code you are running please
Wait
sure ill wait, you can also use our paste service if that is easier then discord code blocks
!paste
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.
#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___")```
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.
!paste
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.
noticce the tags that come up, read them please, it contains information to you π
ans=input what does this line do?
means?
so here, in your code
read them
you didn't remove the print
What i dont understood
your still using print
what shoud i do?
what did i write you should do?
yes, tell me what print is used for?
to print question
it is used to print text on the screen
you cant mix it with input
input already does that
Oooh
or just use input on its own
thanks
do you know what a dictionary is?
i know i am new so i wrote whith my knowledge
so instead of writing 100 lines of code, it can be done in... well... 5 lines
and that is correct
π
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
hope you managed to sort it out! you can come back anytime you want
always share errors
share code please
that only
I thought I helped you fixed this @gritty crow ?
No
always share errors
Coming again
always share code
#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___")```
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.
ans=input("1. What is the capital of India?")
- ans=input
You need to remove that line βοΈ
its night somewhere in the world
yes. Why do you ask?
Did you just discover timezones?
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.

