我使用的是VB.NET,但只要它使用基本特性,任何其他已知的语言都应该可以。
我的任务是创建星座兼容性图,当两个用户有某个星座作为输入,并且有一个关于这些星座兼容性的文本。
对于那些不知道星座但仍然想要帮助的人,这里有12个星座。每个星座与其他星座或自身具有不同的兼容性。所以基本上我进入了12^2-12个条件。即。患有癌症的白羊座“根本不匹配”,所以我可以保存这个问题的一条记录,因为它是相同的(因此在最后是-12 )。
问题很简单,除了使用12^2-12大小写问题之外,还有其他方法可以创建它吗?
即。伪码
if sign1=1 and sign2=4
return "do not ma
我正在编写一个程序与一个下拉菜单,我从一个库中导入。我的目标是获得日和月,并使用它来计算星座。稍后,我将有一个随机的星座数组,这也将显示。但是,在我执行代码后,我得到一个错误:"dates is not defined“。如何从下拉菜单中正确引用日期和月份? var astro_sign
function getzodiac() {
var day = parseInt(document.getElementsByClassName('bear-dates').value);
var month = document.getElementsByClassName(
想象一下,我是一家根据客户姓名销售星座的公司。我有一个包含姓氏、姓氏和星座文字的表格。因为我不能涵盖每一个名字组合,所以我经常将姓氏存储为NULL,作为一个通用的值。 Horoscope DB
sur | fam | horoscope
----------------------
John| Doe | text1
Jane| Doe | text2
NULL| Doe | text3
Ike | Smith| text4
NULL| Smith| text5 和客户列表 customer DB
sur | fam
---------
John| Doe
Jack| Doe
Li
if month == 12:
if 0 < date < 23:
return 'SAG'
if 23 <= date < 32:
return 'CAP'
if month == 1:
if 0 < date < 21:
return 'CAP'
if 21 <= date < 32:
return 'AQU'
if month == 2:
if 0 < date <
制作一个具有不同星座列表的程序,然后要求用户输入它们是什么星座,然后让程序在继续之前检查列表中包含的星座。
问题是它确实会检查它是否在列表中,但它不会重复。
play = True
while play:
print("Welcome to my Pseudo_Sammy program, please enter your name, star sign and then your question by typing it in and pressing the enter key, and I will give you the answer to your quest
while True:
try:
horoscope= int(input("Enter what sign you are: "))
except ValueError:
print("Sorry, please try again")
continue
else:
break
if horoscope =='1':
print("You are a Gemini!")
elif horoscope =='2':