Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

Hi, try this:

***
#include

int main() {

printf("Character Garbage value - %c\n");
printf("Double Garbage value - %lf\n");

return 0;
}
***
one year ago
Hi Meher, please share level. lesson and code to let us help you out.
one year ago
Try now, with this:
***
let x = 10;
let y = 1;
let z;
// your code comes here
(x > y)? z = x : z = y ;
console.log("Value of z:" + z);
***
one year ago
Hi Harshad, This code is correct. What error you got?
one year ago
It is because you are not supposed to add this **console.log(str4);** in the code.
Here is the correct code:
***
let str1 = 'ambush';
let str2 = 101;
let str3 = false;

var str4 = str2 + ' ' + str3 + str1;
console.log(typeof str4);
***
one year ago
Hi Harshad, thanks for reporting this. Please try again with the same code.
2 years ago
Hi Vijay, If you are trying to jumpt to the next related topic of tutorials. You can use the left sidebar or use the navbar on top of the page. Feel free to drop the topic name here and we will provide the next topic ASAP.
2 years ago
Hey buddy, try out this code. Let me know if you still face any error.

***



<br /> My First Page<br />

WELCOME





***
2 years ago
printf function arguments are: **"%d multiplied by %d is %d", x, y, x*y**
2 years ago
Output should be **xy = 1**
2 years ago
***
I have fixed the code little bit:

import random
def select_word():
words_in_computer_memory = ['magazine','stars','computer','python','organisation']
word = random.choice(words_in_computer_memory)
return word
def is_gussed(word, guessed_letter_list):
count=0
for letters in word:
if letters in guessed_letter_list:
count+=1
if count==len(word):
return True
else:
return False
def guessed_word(word, guessed_letter_list):
string=""
for key in word:
if key in guessed_letter_list:
string+=key
else:
string+="_ "
return string
def available_letters(guessed_letter_list):

string=""
count=0
s='abcdefghijklmnopqrstuvwxyz'
for letter in s:
if letter in guessed_letter_list:
count+=1
else:
string+=letter
return string
def hangman_game(word):
length=len(word)
print('''------------------WELCOME TO HANGMAN GAME---------------------------
O
/|\
/ \
''')
print("The word you have to guess is of ",length, "letters long.")
chances=2*len(word)
i=0
guessed_letter_list=[]
while (chances!=0):

if word!=guessed_word(word, guessed_letter_list):
print("You Got", chances, "Chances.")
print("Letters you can enter should be from these ",available_letters(guessed_letter_list))
guess=input("ENTER A LETTER ")
print('\n'*50)

guessInLowerCase = guess[0].lower()
if guessInLowerCase in guessed_letter_list:
print("SORRY! YOU HAVE GUSSED THIS LETTER ALREADY! ",guessed_word(word, guessed_letter_list))
elif guessInLowerCase not in word:
print(" SORRY! THE LETTER IS NOT IN WORD",guessed_word(word, guessed_letter_list))
chances-=1
else:
guessed_letter_list.append(guessInLowerCase)
print("NICE YOU GUSESSED THE RIGHT LETTER! ",guessed_word(word, guessed_letter_list))

elif word==guessed_word(word, guessed_letter_list):
print("YOU WON!")
break

else:
print('''

*
YOU LOSS!!
O
/|\
/ \

''')
print('The word was',word)

word = select_word()
hangman_game(word)
***

Let me know if you face any error.
2 years ago
Your code seems right. Please attach the error you got.
2 years ago