ピザ 男 ⠕
@PizzaMan21
Hello, I'm PizzaMan21 18/single/straight,gamer,anime watcher. Out of touch coder. Lvl 90 FFXIV RP & PLD. Certified dumbass
Home of Florida Man
0
Changing AccountsI'm changing accounts to @KeenarPheoung (not my real name)
0
0
0
1
Talk to MeTalk to Me
10
18
1
1
Java Project Help
Hello! I'm currently working on a project. This is what the program should do:
greet the player and ask him or her to play the game
declare and initialize variables for the loop counter and the player's choice
use System.read.in() to accept the player's guess
create and output messages if the player's guess is wrong, and when the guess is correct
The program should continue untill the player guesses the answer correctly. It doesn't matter which loop it is, but it has to be either a for loop, do-while loop, or the while loop.
Please help me! Thank you! I can send you an invite so you can edit the program.2
The PitlifeThis is my version of Pitlife 5.
10
0
2
How would I add a function with a “return” value in it? Where would I put it if there was?
For example:
def reprompt():
answer = float(input("Nu
Python
Muffinlavania Your code seems to work, high() and low() will both return your input answer.
That should just work lol2 years ago
RYANTADIPARTHI Solution
functions actually do use return statements. Try this.
def sayhello():
return "Hello"
print(sayhello())
with parameters
def withpars(a, b):
return a + b
print(withpars(2, 2))
like that.
That should work2 years ago
Coder100 The return value is the output you can utilize for later use. For example, the input() function returns what the user typed in.
Here is an example
def add(a, b): return a + b
print(add(1, 3))
`2 years ago
Hope you enjoy!
Things to note:
If you don’t want a burger, say no.
If you don’t want a beverage or fries, input yes then no.
Other people who helpe
Python
I trying to make it to where it asks you if the sky is is blue and if you input “True” or “true” or “T” or “t”, than it says your correct or if you in
Python
Dunce if you don't want to input the different capitalizations into your if statements you can also put .lower() at the end of your input command2 years ago
RYANTADIPARTHI Solution
try this code. Use input() for it.
sky = input('is the sky blue ? ')
if 'T' in sky or 't' in sky:
print('correct!')
elif 'f' in sky or 'F' in sky:
print('incorrect')
else:
print('invalid')
like that.
That should work2 years ago
19wintersp You can check if it is in a list of options:
if response in ["true", "True", "T", "t"]:
print("That is correct!")
elif response in ["false", "False", "F", "f"]:
print("That is incorrect!")
else:
print("You entered an invalid answer.")
That code uses the in keyword to check if the response is in the list.2 years ago
Can some please help assist me in replicating this?
13E1A7E3-94C1-4276-AD09-C57122EF2D86
The styling is in the tag for a reason.
Join this team if
HTML, CSS, JS
This is not mine entirely, but I made a few edits.