我如何在谷歌上运行我的python代码,并在不使用任何金钱的情况下向公众或其他用户提供访问权限



我已经用python语言制作了一个程序,它告诉你的星座。我在朱皮特笔记本上做的,蟒蛇。我打开它的单词,它的代码是:{

"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Input birthday: 14n",
"Input month of birth: Februaryn",
"Your Astrological sign is : Aquariusn",
"Element: Airn",
"Quality: Fixedn",
"Color: Light-Blue, Silvern",
"Day: Saturdayn",
"Lucky Numbers: 4, 7, 11, 22, 29n",
"Lucky Metal: Ironn",
"Lucky Stone: Blue Sapphiren",
"Strengths: Progressive, original, independent, humanitariann",
"Weaknesses: Runs from emotional expression, temperamental, uncompromising, aloofn",
"Aquarius likes: Fun with friends, helping others, fighting for causes, intellectual conversation, a good listenern",
"Aquarius dislikes: Limitations, broken promises, being lonely, dull or boring situations, people who disagree with themn"
]
}
],
"source": [
"day = int(input("Input birthday: "))n",
"month = input("Input month of birth: ")n",
"astro_sign=''n",
"if month == 'december' or month == 'December':n",
"tastro_sign = 'Sagittarius' if (day < 22) else 'Capricorn'n",
"elif month == 'january' or month == 'January':n",
"tastro_sign = 'Capricorn' if (day < 20) else 'Aquarius'n",
"elif month == 'february' or month == 'February':n",
"tastro_sign = 'Aquarius' if (day < 19) else 'Pisces'n",
"elif month == 'march' or month == 'March':n",
"tastro_sign = 'Pisces' if (day < 21) else 'Aries'n",
"elif month == 'april' or month == 'April':n",
"tastro_sign = 'Aries' if (day < 20) else 'Taurus'n",
"elif month == 'may' or month == 'May':n",
"tastro_sign = 'Taurus' if (day < 21) else 'Gemini'n",
"elif month == 'june' or month == 'June':n",
"tastro_sign = 'Gemini' if (day < 21) else 'Cancer'n",
"elif month == 'july' or month == 'July':n",
"tastro_sign = 'Cancer' if (day < 23) else 'Leo'n",
"elif month == 'august' or month == 'August':n",
"tastro_sign = 'Leo' if (day < 23) else 'Virgo'n",
"elif month == 'september' or month == 'September':n",
"tastro_sign = 'Virgo' if (day < 23) else 'Libra'n",
"elif month == 'october' or month == 'October':n",
"tastro_sign = 'Libra' if (day < 23) else 'Scorpio'n",
"elif month == 'november' or month == 'November':n",
"tastro_sign = 'Scorpio' if (day < 22) else 'Sagittarius'n",
"else:n",
"  print('Invalid date entered!!!')n",
"print("Your Astrological sign is :",astro_sign)n",
"if astro_sign == 'Sagittarius':n",
"  print('Element: Fire\nQuality: Mutable\nColor: Blue\nDay: Thursday\nLucky Numbers: 1, 3, 7, 9, 12, 21\nLucky Metal: Bronze\nLucky Stone: Yellow Sapphire.\nStrengths: Generous, idealistic, great sense of humor\nWeaknesses: Promises more than can deliver, very impatient, will say anything no matter how undiplomatic\nSagittarius likes: Freedom, travel, philosophy, being outdoors\nSagittarius dislikes: Clingy people, being constrained, off-the-wall theories, details')n",
"elif astro_sign == "Capricorn":n",
"  print("Element: Earth\nQuality: Cardinal\nColor: Brown, Black\nDay: Saturday\nLucky Numbers: 4, 8, 13, 22\nLucky Metal: Iron\nLucky Stone: Blue Sapphire\nStrengths: Responsible, disciplined, self-control, good managers\nWeaknesses: Know-it-all, unforgiving, condescending, expecting the worst\nCapricorn likes: Family, tradition, music, understated status, quality craftsmanship\nCapricorn dislikes: Almost everything at some point")n",
"elif astro_sign == "Aquarius":n",
"  print("Element: Air\nQuality: Fixed\nColor: Light-Blue, Silver\nDay: Saturday\nLucky Numbers: 4, 7, 11, 22, 29\nLucky Metal: Iron\nLucky Stone: Blue Sapphire\nStrengths: Progressive, original, independent, humanitarian\nWeaknesses: Runs from emotional expression, temperamental, uncompromising, aloof\nAquarius likes: Fun with friends, helping others, fighting for causes, intellectual conversation, a good listener\nAquarius dislikes: Limitations, broken promises, being lonely, dull or boring situations, people who disagree with them")n",
"elif astro_sign == "Pisces":n",
"  print("Element: Water\nQuality: Mutable\nColor: Mauve, Lilac, Purple, Violet, Sea green\nDay: Thursday\nLucky Numbers: 3, 9, 12, 15, 18, 24\nLucky Metal: Bronze\nLucky Stone: Yellow Sapphire\nStrengths: Compassionate, artistic, intuitive, gentle, wise, musical\nWeaknesses: Fearful, overly trusting, sad, desire to escape reality, can be a victim or a martyr\nPisces likes: Being alone, sleeping, music, romance, visual media, swimming, spiritual themes\nPisces dislikes: Know-it-all, being criticized, the past coming back to haunt, cruelty of any kind")n",
"elif astro_sign == "Aries":n",
"  print("Element: Fire\nQuality: Cardinal\nColor: Red\nDay: Tuesday\nLucky Numbers: 1, 8, 17\nLucky MetaltCopper\nLucky StonetRed Coral\nStrengths: Courageous, determined, confident, enthusiastic, optimistic, honest, passionate\nWeaknesses: Impatient, moody, short-tempered, impulsive, aggressive\nAries likes: Comfortable clothes, taking on leadership roles, physical challenges, individual sports\nAries dislikes: Inactivity, delays, work that does not use one's talents")n",
"elif astro_sign == "Taurus":n",
"  print("Element: Earth\nQuality: Fixed\nColor: Green, Pink\nDay: Friday, Monday\nLucky Numbers: 2, 6, 9, 12, 24\nLucky Metal: Silver\nLucky Stone: Diamond\nStrengths: Reliable, patient, practical, devoted, responsible, stable\nWeaknesses: Stubborn, possessive, uncompromising\nTaurus likes: Gardening, cooking, music, romance, high quality clothes, working with hands\nTaurus dislikes: Sudden changes, complications, insecurity of any kind, synthetic fabrics")n",
"elif astro_sign == "Gemini":n",
"  print("Element: Air\nQuality: Mutable\nColor: Light-Green, Yellow\nDay: Wednesday\nLucky Numbers: 5, 7, 14, 23\nLucky MetaltBronze\nLucky StonetEmerald\nStrengths: Gentle, affectionate, curious, adaptable, ability to learn quickly and exchange ideas\nWeaknesses: Nervous, inconsistent, indecisive\nGemini likes: Music, books, magazines, chats with nearly anyone, short trips around the town\nGemini dislikes: Being alone, being confined, repetition and routine")n",
"elif astro_sign == "Cancer":n",
"  print("Element: Water\nQuality: Cardinal\nColor: White\nDay: Monday, Thursday\nLucky Numbers: 2, 3, 15, 20\nLucky Metal: Silver\nLucky Stone: Pearl\nStrengths: Tenacious, highly imaginative, loyal, emotional, sympathetic, persuasive\nWeaknesses: Moody, pessimistic, suspicious, manipulative, insecure\nCancer likes: Art, home-based hobbies, relaxing near or in water, helping loved ones, a good meal with friends\nCancer dislikes: Strangers, any criticism of Mom, revealing of personal life")n",
"elif astro_sign == "Leo":n",
"  print("Element: Fire\nQuality: Fixed\nColor: Gold, Yellow, Orange\nDay: Sunday\nLucky Numbers: 1, 3, 10, 19\nLucky Metal: Copper\nLucky StonetRuby\nStrengths: Creative, passionate, generous, warm-hearted, cheerful, humorous\nWeaknesses: Arrogant, stubborn, self-centered, lazy, inflexible\nLeo likes: Theater, taking holidays, being admired, expensive things, bright colors, fun with friends\nLeo dislikes: Being ignored, facing difficult reality, not being treated like a king or queen")n",
"elif astro_sign == "Virgo":n",
"  print("Element: Earth\nQuality: Mutable\nColor: Grey, Beige, Pale-Yellow\nDay: Wednesday\nLucky Numbers: 5, 14, 15, 23, 32\nLucky Metal: Bronze\nLucky Stone Emerald\nStrengths: Loyal, analytical, kind, hardworking, practical\nWeaknesses: Shyness, worry, overly critical of self and others, all work and no play\nVirgo likes: Animals, healthy food, books, nature, cleanliness\nVirgo dislikes: Rudeness, asking for help, taking center stage")n",
"elif astro_sign == "Libra":n",
"  print("Element: Air\nQuality: Cardinal\nColor: Pink, Green\nDay: Friday\nLucky Numbers: 4, 6, 13, 15, 24\nLucky MetaltSilver\nLucky StonetDiamond\nStrengths: Cooperative,diplomatic, gracious, fair-minded, social\nWeaknesses: Indecisive, avoids confrontations, will carry a grudge, self-pity\nLibra likes: Harmony, gentleness, sharing with others, the outdoors\nLibra dislikes: Violence, injustice, loudmouths, conformity")n",
"elif astro_sign == "Scorpio":n",
"  print("Element: Water\nQuality: Fixed\nColor: Scarlet, Red, Rust\nDay: Tuesday\nLucky Numbers: 8, 11, 18, 22\nLucky MetaltCopper\nLucky StonetRed Coral\nStrengths: Resourceful, brave, passionate, stubborn, a true friend\nWeaknesses: Distrusting, jealous, secretive, violent\nScorpio likes: Truth, facts, being right, longtime friends, teasing, a grand passion\nScorpio dislikes: Dishonesty, revealing secrets, passive people")n",
"else:n",
"  print("You've entered the wrong date so no sign traits for youuuu!!!!")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

而在Jupiter笔记本上,代码是:

day = int(input("Input birthday: "))
month = input("Input month of birth: ")
astro_sign=''
if month == 'december' or month == 'December':
astro_sign = 'Sagittarius' if (day < 22) else 'Capricorn'
elif month == 'january' or month == 'January':
astro_sign = 'Capricorn' if (day < 20) else 'Aquarius'
elif month == 'february' or month == 'February':
astro_sign = 'Aquarius' if (day < 19) else 'Pisces'
elif month == 'march' or month == 'March':
astro_sign = 'Pisces' if (day < 21) else 'Aries'
elif month == 'april' or month == 'April':
astro_sign = 'Aries' if (day < 20) else 'Taurus'
elif month == 'may' or month == 'May':
astro_sign = 'Taurus' if (day < 21) else 'Gemini'
elif month == 'june' or month == 'June':
astro_sign = 'Gemini' if (day < 21) else 'Cancer'
elif month == 'july' or month == 'July':
astro_sign = 'Cancer' if (day < 23) else 'Leo'
elif month == 'august' or month == 'August':
astro_sign = 'Leo' if (day < 23) else 'Virgo'
elif month == 'september' or month == 'September':
astro_sign = 'Virgo' if (day < 23) else 'Libra'
elif month == 'october' or month == 'October':
astro_sign = 'Libra' if (day < 23) else 'Scorpio'
elif month == 'november' or month == 'November':
astro_sign = 'Scorpio' if (day < 22) else 'Sagittarius'
else:
print('Invalid date entered!!!')
print("Your Astrological sign is :",astro_sign)
if astro_sign == 'Sagittarius':
print('Element: FirenQuality: MutablenColor: BluenDay: ThursdaynLucky Numbers: 1, 3, 7, 9, 12, 21nLucky Metal: BronzenLucky Stone: Yellow Sapphire.nStrengths: Generous, idealistic, great sense of humornWeaknesses: Promises more than can deliver, very impatient, will say anything no matter how undiplomaticnSagittarius likes: Freedom, travel, philosophy, being outdoorsnSagittarius dislikes: Clingy people, being constrained, off-the-wall theories, details')
elif astro_sign == "Capricorn":
print("Element: EarthnQuality: CardinalnColor: Brown, BlacknDay: SaturdaynLucky Numbers: 4, 8, 13, 22nLucky Metal: IronnLucky Stone: Blue SapphirenStrengths: Responsible, disciplined, self-control, good managersnWeaknesses: Know-it-all, unforgiving, condescending, expecting the worstnCapricorn likes: Family, tradition, music, understated status, quality craftsmanshipnCapricorn dislikes: Almost everything at some point")
elif astro_sign == "Aquarius":
print("Element: AirnQuality: FixednColor: Light-Blue, SilvernDay: SaturdaynLucky Numbers: 4, 7, 11, 22, 29nLucky Metal: IronnLucky Stone: Blue SapphirenStrengths: Progressive, original, independent, humanitariannWeaknesses: Runs from emotional expression, temperamental, uncompromising, aloofnAquarius likes: Fun with friends, helping others, fighting for causes, intellectual conversation, a good listenernAquarius dislikes: Limitations, broken promises, being lonely, dull or boring situations, people who disagree with them")
elif astro_sign == "Pisces":
print("Element: WaternQuality: MutablenColor: Mauve, Lilac, Purple, Violet, Sea greennDay: ThursdaynLucky Numbers: 3, 9, 12, 15, 18, 24nLucky Metal: BronzenLucky Stone: Yellow SapphirenStrengths: Compassionate, artistic, intuitive, gentle, wise, musicalnWeaknesses: Fearful, overly trusting, sad, desire to escape reality, can be a victim or a martyrnPisces likes: Being alone, sleeping, music, romance, visual media, swimming, spiritual themesnPisces dislikes: Know-it-all, being criticized, the past coming back to haunt, cruelty of any kind")
elif astro_sign == "Aries":
print("Element: FirenQuality: CardinalnColor: RednDay: TuesdaynLucky Numbers: 1, 8, 17nLucky Metal   CoppernLucky Stone Red CoralnStrengths: Courageous, determined, confident, enthusiastic, optimistic, honest, passionatenWeaknesses: Impatient, moody, short-tempered, impulsive, aggressivenAries likes: Comfortable clothes, taking on leadership roles, physical challenges, individual sportsnAries dislikes: Inactivity, delays, work that does not use one's talents")
elif astro_sign == "Taurus":
print("Element: EarthnQuality: FixednColor: Green, PinknDay: Friday, MondaynLucky Numbers: 2, 6, 9, 12, 24nLucky Metal: SilvernLucky Stone: DiamondnStrengths: Reliable, patient, practical, devoted, responsible, stablenWeaknesses: Stubborn, possessive, uncompromisingnTaurus likes: Gardening, cooking, music, romance, high quality clothes, working with handsnTaurus dislikes: Sudden changes, complications, insecurity of any kind, synthetic fabrics")
elif astro_sign == "Gemini":
print("Element: AirnQuality: MutablenColor: Light-Green, YellownDay: WednesdaynLucky Numbers: 5, 7, 14, 23nLucky Metal   BronzenLucky Stone EmeraldnStrengths: Gentle, affectionate, curious, adaptable, ability to learn quickly and exchange ideasnWeaknesses: Nervous, inconsistent, indecisivenGemini likes: Music, books, magazines, chats with nearly anyone, short trips around the townnGemini dislikes: Being alone, being confined, repetition and routine")
elif astro_sign == "Cancer":
print("Element: WaternQuality: CardinalnColor: WhitenDay: Monday, ThursdaynLucky Numbers: 2, 3, 15, 20nLucky Metal: SilvernLucky Stone: PearlnStrengths: Tenacious, highly imaginative, loyal, emotional, sympathetic, persuasivenWeaknesses: Moody, pessimistic, suspicious, manipulative, insecurenCancer likes: Art, home-based hobbies, relaxing near or in water, helping loved ones, a good meal with friendsnCancer dislikes: Strangers, any criticism of Mom, revealing of personal life")
elif astro_sign == "Leo":
print("Element: FirenQuality: FixednColor: Gold, Yellow, OrangenDay: SundaynLucky Numbers: 1, 3, 10, 19nLucky Metal: CoppernLucky Stone RubynStrengths: Creative, passionate, generous, warm-hearted, cheerful, humorousnWeaknesses: Arrogant, stubborn, self-centered, lazy, inflexiblenLeo likes: Theater, taking holidays, being admired, expensive things, bright colors, fun with friendsnLeo dislikes: Being ignored, facing difficult reality, not being treated like a king or queen")
elif astro_sign == "Virgo":
print("Element: EarthnQuality: MutablenColor: Grey, Beige, Pale-YellownDay: WednesdaynLucky Numbers: 5, 14, 15, 23, 32nLucky Metal: BronzenLucky Stone EmeraldnStrengths: Loyal, analytical, kind, hardworking, practicalnWeaknesses: Shyness, worry, overly critical of self and others, all work and no playnVirgo likes: Animals, healthy food, books, nature, cleanlinessnVirgo dislikes: Rudeness, asking for help, taking center stage")
elif astro_sign == "Libra":
print("Element: AirnQuality: CardinalnColor: Pink, GreennDay: FridaynLucky Numbers: 4, 6, 13, 15, 24nLucky Metal SilvernLucky Stone DiamondnStrengths: Cooperative,diplomatic, gracious, fair-minded, socialnWeaknesses: Indecisive, avoids confrontations, will carry a grudge, self-pitynLibra likes: Harmony, gentleness, sharing with others, the outdoorsnLibra dislikes: Violence, injustice, loudmouths, conformity")
elif astro_sign == "Scorpio":
print("Element: WaternQuality: FixednColor: Scarlet, Red, RustnDay: TuesdaynLucky Numbers: 8, 11, 18, 22nLucky Metal CoppernLucky Stone Red CoralnStrengths: Resourceful, brave, passionate, stubborn, a true friendnWeaknesses: Distrusting, jealous, secretive, violentnScorpio likes: Truth, facts, being right, longtime friends, teasing, a grand passionnScorpio dislikes: Dishonesty, revealing secrets, passive people")
else:
print("You've entered the wrong date so no sign traits for youuuu!!!!")

所以我如何才能让这个代码在谷歌上公开显示,并可以在不使用任何金钱的情况下与朋友和家人共享链接

Colab与jupyter笔记本非常相似,可以免费使用。添加代码后,只需将链接发送给其他人即可。https://colab.research.google.com/是链接。快速指南是:https://colab.research.google.com/github/jckantor/CBE30338/blob/master/docs/01.01-Getting-Started-with-Python-and-Jupyter-Notebooks.ipynb

在Google Colab 上尝试类似jupyter的笔记本

相关内容

  • 没有找到相关文章

最新更新