Nexclap

regression problems in machine learning

here is my blog on regression problems in machine learning

https://www.siliconvalley4u.com/blogs/regression-in-machine-learning

Python 1A Project

///Python 1A - Number and Text Manipulation Examples///

#1. Write a Python program that asks the user to enter their age. Based on the entered age, print the following messages: #If the age is less than 18, print "You are a minor." #If the age is between 18 and 65 (inclusive), print "You are an adult." #If the age is greater than 65, print "You are a senior citizen." #Once printed the option, tell the user when they will be in that specific age group. For example, if a user is 16, you will print out that the user will be an adult in 2 years. age = int(input("What is your age:")) if age < 18 : print("You are a minor") ge = 18 - age print("In " + str(ge) + " years you will be an adult") elif age < 65 and age >= 18 : print("You are an adult") e = 65 - age print("In " + str(e) + " years you will be a senior") elif age >= 65: print("You are a senior") #2. Write a Python program that asks the user to enter a sentence. The program should count and print the number of vowels (a, e, i, o, u) in the sentence.Once counted, replace each vowel with an underscore. #If the value of n is a vowel, add _ to sen. If the value of n is not a vowel, add n to sen. from replace import replace sent = str(input("Enter type sentence (please type in lowercase)//")) num = 0 a = "a" e = "e" i = "i" o = "o" u = "u" for n in sent: if n == a or n == e or n == i or n == o or n == u : num = num + 1 print (num) vow = ["a", "e", "i", "o", "u"] for n in sent: if n == a or n == e or n == i or n == o or n == u : print(n) for r in vow: sent = sent.replace(r, "_") print(sent) #3. Write a Python program that asks the user to enter a word and then prints the word in reverse order. reverse = "" word = str(input("Enter a word: ")) for n in word: reverse = n + reverse print(reverse)

Battleship

Homework

{console.log("Lets play battleship! You have 4 turns to find the ship!"); } {rounds = 4; } var grid = [ ["O", "O", "O", "O", "O"], ["O", "O", "O", "O", "O"], ["O", "O", "O", "O", "O"], ["O", "O", "O", "O", "O"], ["O", "O", "O", "O", "O"] ] console.log(grid, rounds); function battleship(grid,rounds){ var x = Math.floor(Math.random()*4); var y = Math.floor(Math.random()*4); var usery = prompt("Guess row 0-4: "); var userx = prompt("Guess column 0-4: "); rounds = 4 var i = 1; while (i<(rounds)){ if ((userx != x && y != usery) || (userx == x && y != usery) || (userx != x && y == usery)){ grid[userx][usery]='X'; console.log("You missed my battleship! You have used "+i+" turns out of "+rounds); console.log(grid); var usery = prompt("Guess row: "); var userx = prompt("Guess column: "); i+=1 if (userx > 4){ console.log("Values must be between 0 and 4!"); } if (usery > 4){ console.log("Values must be between 0 and 4!"); } } else if (userx==x && usery==y){ grid[userx][usery]='∆'; console.log("You sunk my battleship! You won!"); console.log(grid); break; } i+=0; } console.log("You lost! The correct coordinates were "+x+","+y); } battleship(grid,4);
Announcements
  • Test Announcement from Nexclap

    Test message from nexclap - please ignore

    2023-02-13

  • Test message

    Test message from nexclap - please ignore

    2023-02-11

  • Test message

    Test message from nexclap - please ignore

    2023-02-11

  • View all