why one code is working and another is not?

I Have Created age conditions in the prompt but one code is working and another is not? I know I have put the prompt in the let only then it is working but why so? // My Code(Not Working) let pillu = 20; prompt("whats you age"); if(pillu>=20){ alert("you are eligible"); } else{ alert("you are not… Read More why one code is working and another is not?

I am trying to fetch information from phpmyadmin database, but in browser it's showing cannot get/employee and in command prompt there is no error

const { json } = require(‘express/lib/response’); const mysql=require (‘mysql’); const express=require(‘express’); var app=express(); const bodyparser=require(‘body-parser’); app.use(bodyparser.json()); var mysqlConnection=mysql.createConnection({ host:’localhost’, user: ‘root’, password:”, database: ’employee_db’ }); mysqlConnection.connect((err)=>{ if(!err) { console.log("DB connection is successfull"); } else{ console.log("DB connection failed "+JSON.stringify(err,undefined,2)); } }); app.listen(8000,()=>console.log(‘Express server is running on port number: 8000’)); app.get(‘/employess’,(res,req)=>{ mysqlConnection.query(‘SELECT * FROM EMPLOYEE’,(err,rows,fields)=>{ if(!err) {… Read More I am trying to fetch information from phpmyadmin database, but in browser it's showing cannot get/employee and in command prompt there is no error

How to run a PowerShell cmdlet in Python to get a list of connected USB devices?

I try to list connected USB devices in my Python project. I tried to use os.system() with a command prompt but I cannot find a command for command prompt to list connected USB devices (names). I found a PowerShell command which is Get-PnpDevice -PresentOnly | Where-Object { $_. InstanceId -match ‘^USB’ } That works fine.… Read More How to run a PowerShell cmdlet in Python to get a list of connected USB devices?

Is there a way to convert a NoneType into a String?

Is there a way to convert a NoneType that the user inputs into a string, in python? This is my code: topping = print(input("What topping would you like on your pizza?")) requested_toppings = [] requested_toppings.append(topping) print("Adding" + topping + "…") print("\n Finished Making Your Pizza!") The error is, Type Error: can only concatenate str (not… Read More Is there a way to convert a NoneType into a String?

python command prompt in ptp

using $lang() {} for python. $lang("Python") { print("c:/documents/files/commandprompt/python.py") print("enter a name:") x = input("c:/python.py/input>") print("hello, " + x + "! Welcome to the command prompt, Type ‘?’ for help"); a1 = input("c:/files/?" + x + ">"); } #py = $(document).element("lang" + ?Input: + "Python"); $function getVari(pl, var) { $lang(pl); { $(./*[^/s]).ptp($(main).parameter("var"):$(main).variable([^/s].any;)) } #x = getVari("Python",… Read More python command prompt in ptp