if-statement

Continuos loop with user input condition in python?

耗尽温柔 提交于 2021-02-11 13:11:22
问题 I just learn my first python and try to make a continuous loop that has a user input condition. #Make the calculating func def data_cal(): pennies = int(input("What's your pennies?")) dollars = pennies // 100 cents = pennies % 100 print("You have $", dollars, "and", cents, "cents") data_cal() #User input for answer repeat = input("Do you want to try again?") answer = ['yes','YES','Yes','y','Y'] #Loop for answer while repeat in answer data_cal() else: print("Bye then") I was thinking if I can

Continuos loop with user input condition in python?

旧城冷巷雨未停 提交于 2021-02-11 13:08:41
问题 I just learn my first python and try to make a continuous loop that has a user input condition. #Make the calculating func def data_cal(): pennies = int(input("What's your pennies?")) dollars = pennies // 100 cents = pennies % 100 print("You have $", dollars, "and", cents, "cents") data_cal() #User input for answer repeat = input("Do you want to try again?") answer = ['yes','YES','Yes','y','Y'] #Loop for answer while repeat in answer data_cal() else: print("Bye then") I was thinking if I can

Continuos loop with user input condition in python?

痴心易碎 提交于 2021-02-11 13:04:57
问题 I just learn my first python and try to make a continuous loop that has a user input condition. #Make the calculating func def data_cal(): pennies = int(input("What's your pennies?")) dollars = pennies // 100 cents = pennies % 100 print("You have $", dollars, "and", cents, "cents") data_cal() #User input for answer repeat = input("Do you want to try again?") answer = ['yes','YES','Yes','y','Y'] #Loop for answer while repeat in answer data_cal() else: print("Bye then") I was thinking if I can

how to clear or overwrite document.write() on browser when my next filter(basically a condition) match in JS

十年热恋 提交于 2021-02-11 12:50:53
问题 I have an array of objects. let mainMenu = [ { brand: "Zara", type: "Shirt", gender: ["Men", "Women", "Boys", "Girls"], size: "Small", image: "", description: "", price: "300", colour: "Red", stock: "10", discount: 5, rating: "4" }, { brand: "Nike", type: "Shirt", gender: ["Men", "Women", "Boys"], size: "Medium", image: "", description: "", price: "600", colour: "Red", stock: "20", discount: 5, rating: "5" }, { brand: "Adidas", type: "Shirt", gender: ["Men", "Women"], size: "Large", image: ""

Possible to use IF in a query?

拈花ヽ惹草 提交于 2021-02-11 12:47:14
问题 I'm using Grafana to plot data from a MySQL datasource. Is it possible to, in a panel's query editor, use an IF ... THEN ... type statement. I would like to create a variable that I could put in the IF. I want the variable to be a condition, not necessarily to be used directly in the query. For example: //IN THE DATA SOURCE: CREATE TABLE Example (Id INT, ANIMALS VARCHAR(15)); INSERT INTO Example VALUES (1,'Dog'), (2,'Fish'), (3,'Cat'), (4,'Lizard') For a variable Test with values "Mammal',

Avoiding several nested if statements

我怕爱的太早我们不能终老 提交于 2021-02-11 12:42:45
问题 I'm writing a function that pushes specific (predefined) variables to predefined arrays based on the status of 4 variables, all of which are ranging from 1 to 5 (they are the results of radio buttons pressed on our web page). If the variables equal A, B, C and D, the predefined variables to predefined arrays X, Y and Z are defined by: X = the combination of A and B. Y = the combination of C and D. Z = the combination of A, B, C and D. Below is my realization of a solution to said problem (A,

Iterate each user on instagram with specific conditions

烂漫一生 提交于 2021-02-11 12:42:40
问题 I am using selenium and im trying to filter a specific users on instagram with 2 condition : If the profile doesn't have a profile pic (instagram's default pic contains "YW5vbnl..." string) If i already follow this user enter image description here but he doesn't iterate all user, he just iterate 12 times the result of last user however this user is eligible Simple example: enter image description here enter image description here PS : sorry for mistake i am beginner on python 😁 try: browser

Iterate each user on instagram with specific conditions

旧时模样 提交于 2021-02-11 12:41:56
问题 I am using selenium and im trying to filter a specific users on instagram with 2 condition : If the profile doesn't have a profile pic (instagram's default pic contains "YW5vbnl..." string) If i already follow this user enter image description here but he doesn't iterate all user, he just iterate 12 times the result of last user however this user is eligible Simple example: enter image description here enter image description here PS : sorry for mistake i am beginner on python 😁 try: browser

R Shiny - Is it possible to nest reactive functions?

倖福魔咒の 提交于 2021-02-11 12:40:25
问题 In R-Shiny. Trying to break up a really long reactive function (thousands of lines!). Hypothetically, is it possible to nest conditional reactive functions, something similar to: STATE_filter <- reactive({ if(input$selectcounty ends with "-AL") { run AL_filter() } else if (input$selectstate ends with "-AR"){ run AR_filter() } else { return("ERROR") } }) EDIT Non-hypothetically, I'm trying to create a nested reactive filtering function based on user select inputs of U.S. counties. Upon their

R Shiny - Is it possible to nest reactive functions?

不打扰是莪最后的温柔 提交于 2021-02-11 12:40:23
问题 In R-Shiny. Trying to break up a really long reactive function (thousands of lines!). Hypothetically, is it possible to nest conditional reactive functions, something similar to: STATE_filter <- reactive({ if(input$selectcounty ends with "-AL") { run AL_filter() } else if (input$selectstate ends with "-AR"){ run AR_filter() } else { return("ERROR") } }) EDIT Non-hypothetically, I'm trying to create a nested reactive filtering function based on user select inputs of U.S. counties. Upon their