Alphabet completion rateMorse Decode GolfHow bold is this post?Bacon's cipher: An Intro to SteganographyOutput the alphabet, the ALPHABET, or just a characterGolf a SentenceTwisting SentencesA Zealous “Quick Brown Fox” “Jumped” Along the Groovy SpiralAlphabet cannonM_ss_ng Lette_sFind a recursive acronym

Russian equivalents of 能骗就骗 (if you can cheat, then cheat)

Is having 4 bed leveling adjustment points rather than 3 problematic?

Delete all files from a folder using a bat that match a certain pattern in Windows 10

Dynamic Sql Query - how to add an int to the code?

Can US Supreme Court justices / judges be "rotated" out against their will?

Did the Russian Empire have a claim to Sweden? Was there ever a time where they could have pursued it?

How do I keep a running total of data in a column in Excel?

Journal standards vs. personal standards

Active wildlife outside the window- Good or Bad for Cat psychology?

Is it advisable to inform the CEO about his brother accessing his office?

A* pathfinding algorithm too slow

Rear derailleur got caught in the spokes, what could be a root cause

Why didn't Caesar move against Sextus Pompey immediately after Munda?

German idiomatic equivalents of 能骗就骗 (if you can trick, then trick)

Should Catholics in a state of grace call themselves sinners?

Automorphisms and epimorphisms of finite groups

What does 'in attendance' mean on a death certificate - England?

What was the first science fiction or fantasy multiple choice book?

Robots in a spaceship

Is it theoretically possible to hack printer using scanner tray?

Do electrons really perform instantaneous quantum leaps?

How would one prevent political gerrymandering?

How do banks maintain reserves?

What was the point of separating stdout and stderr?



Alphabet completion rate


Morse Decode GolfHow bold is this post?Bacon's cipher: An Intro to SteganographyOutput the alphabet, the ALPHABET, or just a characterGolf a SentenceTwisting SentencesA Zealous “Quick Brown Fox” “Jumped” Along the Groovy SpiralAlphabet cannonM_ss_ng Lette_sFind a recursive acronym













28












$begingroup$


Introduction



How much of the English alphabet does a given string use? The previous sentence uses 77%. It has 20 unique letters (howmucftenglisapbdvr), and 20/26 ≃ 0.77.



Challenge



For an input string, return the percentage of letters of the English alphabet present in the string.



  • The answer can be in percentage or in decimal form.


  • The input string can have upper and lower case, as well as punctuation. However you can assume they have no diacritics or accentuated characters.


Test cases



Input



"Did you put your name in the Goblet of Fire, Harry?" he asked calmly.


Some valid outputs



77%, 76.9, 0.7692


Input:



The quick brown fox jumps over the lazy dog


All valid outputs:



100%, 100, 1


The expected output for "@#$%^&*?!" and "" is 0.










share|improve this question











$endgroup$







  • 3




    $begingroup$
    Suggested test cases: "@#$%^&*?!", ""
    $endgroup$
    – Adám
    Jun 21 at 10:35






  • 4




    $begingroup$
    If 77% and 76.9 is accepted, is 77 accepted too?
    $endgroup$
    – Grzegorz Oledzki
    Jun 21 at 10:43










  • $begingroup$
    Percentages can have decimal parts too...
    $endgroup$
    – Jo King
    Jun 21 at 11:54







  • 2




    $begingroup$
    @Shaggy Last edit for OP was 16 hours ago, your answer was at 15 and your comment at 14. I mean, you're right but ???
    $endgroup$
    – Veskah
    Jun 22 at 4:16






  • 4




    $begingroup$
    If 20/26 may be rounded to 0.7692, 0.769 or 0.77, can I also round it to 0.8, 1 or 0? ;-)
    $endgroup$
    – Noiralef
    Jun 22 at 22:42















28












$begingroup$


Introduction



How much of the English alphabet does a given string use? The previous sentence uses 77%. It has 20 unique letters (howmucftenglisapbdvr), and 20/26 ≃ 0.77.



Challenge



For an input string, return the percentage of letters of the English alphabet present in the string.



  • The answer can be in percentage or in decimal form.


  • The input string can have upper and lower case, as well as punctuation. However you can assume they have no diacritics or accentuated characters.


Test cases



Input



"Did you put your name in the Goblet of Fire, Harry?" he asked calmly.


Some valid outputs



77%, 76.9, 0.7692


Input:



The quick brown fox jumps over the lazy dog


All valid outputs:



100%, 100, 1


The expected output for "@#$%^&*?!" and "" is 0.










share|improve this question











$endgroup$







  • 3




    $begingroup$
    Suggested test cases: "@#$%^&*?!", ""
    $endgroup$
    – Adám
    Jun 21 at 10:35






  • 4




    $begingroup$
    If 77% and 76.9 is accepted, is 77 accepted too?
    $endgroup$
    – Grzegorz Oledzki
    Jun 21 at 10:43










  • $begingroup$
    Percentages can have decimal parts too...
    $endgroup$
    – Jo King
    Jun 21 at 11:54







  • 2




    $begingroup$
    @Shaggy Last edit for OP was 16 hours ago, your answer was at 15 and your comment at 14. I mean, you're right but ???
    $endgroup$
    – Veskah
    Jun 22 at 4:16






  • 4




    $begingroup$
    If 20/26 may be rounded to 0.7692, 0.769 or 0.77, can I also round it to 0.8, 1 or 0? ;-)
    $endgroup$
    – Noiralef
    Jun 22 at 22:42













28












28








28


1



$begingroup$


Introduction



How much of the English alphabet does a given string use? The previous sentence uses 77%. It has 20 unique letters (howmucftenglisapbdvr), and 20/26 ≃ 0.77.



Challenge



For an input string, return the percentage of letters of the English alphabet present in the string.



  • The answer can be in percentage or in decimal form.


  • The input string can have upper and lower case, as well as punctuation. However you can assume they have no diacritics or accentuated characters.


Test cases



Input



"Did you put your name in the Goblet of Fire, Harry?" he asked calmly.


Some valid outputs



77%, 76.9, 0.7692


Input:



The quick brown fox jumps over the lazy dog


All valid outputs:



100%, 100, 1


The expected output for "@#$%^&*?!" and "" is 0.










share|improve this question











$endgroup$




Introduction



How much of the English alphabet does a given string use? The previous sentence uses 77%. It has 20 unique letters (howmucftenglisapbdvr), and 20/26 ≃ 0.77.



Challenge



For an input string, return the percentage of letters of the English alphabet present in the string.



  • The answer can be in percentage or in decimal form.


  • The input string can have upper and lower case, as well as punctuation. However you can assume they have no diacritics or accentuated characters.


Test cases



Input



"Did you put your name in the Goblet of Fire, Harry?" he asked calmly.


Some valid outputs



77%, 76.9, 0.7692


Input:



The quick brown fox jumps over the lazy dog


All valid outputs:



100%, 100, 1


The expected output for "@#$%^&*?!" and "" is 0.







code-golf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 21 at 12:09







Teleporting Goat

















asked Jun 21 at 10:13









Teleporting GoatTeleporting Goat

3925 silver badges8 bronze badges




3925 silver badges8 bronze badges







  • 3




    $begingroup$
    Suggested test cases: "@#$%^&*?!", ""
    $endgroup$
    – Adám
    Jun 21 at 10:35






  • 4




    $begingroup$
    If 77% and 76.9 is accepted, is 77 accepted too?
    $endgroup$
    – Grzegorz Oledzki
    Jun 21 at 10:43










  • $begingroup$
    Percentages can have decimal parts too...
    $endgroup$
    – Jo King
    Jun 21 at 11:54







  • 2




    $begingroup$
    @Shaggy Last edit for OP was 16 hours ago, your answer was at 15 and your comment at 14. I mean, you're right but ???
    $endgroup$
    – Veskah
    Jun 22 at 4:16






  • 4




    $begingroup$
    If 20/26 may be rounded to 0.7692, 0.769 or 0.77, can I also round it to 0.8, 1 or 0? ;-)
    $endgroup$
    – Noiralef
    Jun 22 at 22:42












  • 3




    $begingroup$
    Suggested test cases: "@#$%^&*?!", ""
    $endgroup$
    – Adám
    Jun 21 at 10:35






  • 4




    $begingroup$
    If 77% and 76.9 is accepted, is 77 accepted too?
    $endgroup$
    – Grzegorz Oledzki
    Jun 21 at 10:43










  • $begingroup$
    Percentages can have decimal parts too...
    $endgroup$
    – Jo King
    Jun 21 at 11:54







  • 2




    $begingroup$
    @Shaggy Last edit for OP was 16 hours ago, your answer was at 15 and your comment at 14. I mean, you're right but ???
    $endgroup$
    – Veskah
    Jun 22 at 4:16






  • 4




    $begingroup$
    If 20/26 may be rounded to 0.7692, 0.769 or 0.77, can I also round it to 0.8, 1 or 0? ;-)
    $endgroup$
    – Noiralef
    Jun 22 at 22:42







3




3




$begingroup$
Suggested test cases: "@#$%^&*?!", ""
$endgroup$
– Adám
Jun 21 at 10:35




$begingroup$
Suggested test cases: "@#$%^&*?!", ""
$endgroup$
– Adám
Jun 21 at 10:35




4




4




$begingroup$
If 77% and 76.9 is accepted, is 77 accepted too?
$endgroup$
– Grzegorz Oledzki
Jun 21 at 10:43




$begingroup$
If 77% and 76.9 is accepted, is 77 accepted too?
$endgroup$
– Grzegorz Oledzki
Jun 21 at 10:43












$begingroup$
Percentages can have decimal parts too...
$endgroup$
– Jo King
Jun 21 at 11:54





$begingroup$
Percentages can have decimal parts too...
$endgroup$
– Jo King
Jun 21 at 11:54





2




2




$begingroup$
@Shaggy Last edit for OP was 16 hours ago, your answer was at 15 and your comment at 14. I mean, you're right but ???
$endgroup$
– Veskah
Jun 22 at 4:16




$begingroup$
@Shaggy Last edit for OP was 16 hours ago, your answer was at 15 and your comment at 14. I mean, you're right but ???
$endgroup$
– Veskah
Jun 22 at 4:16




4




4




$begingroup$
If 20/26 may be rounded to 0.7692, 0.769 or 0.77, can I also round it to 0.8, 1 or 0? ;-)
$endgroup$
– Noiralef
Jun 22 at 22:42




$begingroup$
If 20/26 may be rounded to 0.7692, 0.769 or 0.77, can I also round it to 0.8, 1 or 0? ;-)
$endgroup$
– Noiralef
Jun 22 at 22:42










35 Answers
35






active

oldest

votes













1 2
next












14












$begingroup$


Python 3, 42 bytes





lambda s:len(*s.upper()-*s.lower())/26


Try it online!



We filter all the non-alphabetic characters out of the string by taking the (set) difference of the uppercase and lowercase representations. Then, we take the length and divide by 26.




Python 3, 46 bytes



lambda s:sum(map(str.isalpha,*s.lower()))/26


Try it online!



Count the unique alphabetic (lowercase) characters, and divide by 26. In Python 2 it would require 3 more characters; two for changing *... to set(...), and one for making 26 a float: 26., to avoid floor division.




Python 3, 46 bytes



lambda s:sum('`'<c<'bc -l
$endgroup$
– wastl
Jun 21 at 13:12










  • $begingroup$
    Right. The variable is a reminder after another attempt. Thanks!
    $endgroup$
    – Grzegorz Oledzki
    Jun 21 at 15:24






  • 3




    $begingroup$
    42 bytes
    $endgroup$
    – Nahuel Fouilleul
    Jun 21 at 15:29











  • $begingroup$
    Can't "grep -io [a-z]" be shortened to "grep -o [A-z]" ?
    $endgroup$
    – Gnudiff
    Jun 23 at 6:13










  • $begingroup$
    @Gnudiff Assuming ASCII, that would also match all of [^_`].
    $endgroup$
    – jnfnt
    Jun 23 at 23:45










  • share|improve this answer









    $endgroup$




















      1












      $begingroup$


      Python 2, 57 bytes





      lambda i:len(set(o for o in i.lower()if o.isalpha()))/26.


      Try it online!



      A bit longer than the Python 3 answer from ArBo but posted as a different approach in Python 2 anyway.






      share|improve this answer











      $endgroup$




















        1












        $begingroup$


        Jelly, 8 bytes



        ŒuØAe€Æm


        Try it online!



        Explanation



        Œu | Convert to upper case
        ØAe€ | Check whether each capital letter is present, returning a list of 26 0s and 1s
        Æm | Mean





        share|improve this answer











        $endgroup$




















          1












          $begingroup$

          C, 95 bytes



          f(char*s)32]=1;for(z=97;z<'z';*a+=a[z++]);return(*a*100)/26;


          (note: rounds down)



          Alternate decimal-returning version (95 bytes):



          float f(char*s)int a[256]=,z;while(*s&&a[*s++


          This borrows some from @Steadybox' answer.






          share|improve this answer








          New contributor



          Anonymous is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          $endgroup$








          • 1




            $begingroup$
            Welcome! Good first answer. It might be helpful for people reading your answer if you provide a short explanation of your code or an ungolfed version. It may also be helpful to provide a link to an online interpreter with your runnable code (see some other answers for examples). Many use TIO, and here's the gcc interpreter
            $endgroup$
            – mbomb007
            Jun 23 at 0:13


















          1












          $begingroup$


          K4, 14 13 bytes



          Solution:



          avg .Q.a in _


          Explanation:



          Rather stolen from inspired by Luis Mendo's Octave solution...



          avg .Q.a in _ / the solution
          _ / lowercase the input
          in / 'in' function
          .Q.a / "abcdefghijklmnopqrstuvwxyz"
          avg / average (mean)





          share|improve this answer











          $endgroup$




















            1












            $begingroup$


            Python 3, 51 49 bytes



            -2 bytes, thanks to alexz02





            lambda s:len(*filter(str.isalpha,s.lower()))/26


            Try it online!






            share|improve this answer











            $endgroup$












            • $begingroup$
              49 bytes lambda s:len(*filter(str.isalpha,s.lower()))/26
              $endgroup$
              – alexz02
              Jun 24 at 8:34










            • $begingroup$
              @alexz02 Thank you! :)
              $endgroup$
              – ruohola
              Jun 24 at 8:42


















            1












            $begingroup$


            JavaScript (Node.js), 45 bytes





            s=>~-s.match(/$|([a-z])(?!.*1)/ig).length/26


            Try it online!





            JavaScript (Node.js), 47 bytes





            s=>(s.match(/([a-z])(?!.*1)/ig)||[]).length/26


            Try it online!






            share|improve this answer











            $endgroup$




















              0












              $begingroup$


              V, 30, 29 bytes



              ÓÁ
              òó㈁“±òAÝ/26.0|Óá
              C="


              Try it online!






              share|improve this answer











              $endgroup$
















                1 2
                next






                Your Answer






                StackExchange.ifUsing("editor", function ()
                StackExchange.using("externalEditor", function ()
                StackExchange.using("snippets", function ()
                StackExchange.snippets.init();
                );
                );
                , "code-snippets");

                StackExchange.ready(function()
                var channelOptions =
                tags: "".split(" "),
                id: "200"
                ;
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function()
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled)
                StackExchange.using("snippets", function()
                createEditor();
                );

                else
                createEditor();

                );

                function createEditor()
                StackExchange.prepareEditor(
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: false,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: null,
                bindNavPrevention: true,
                postfix: "",
                imageUploader:
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                ,
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                );



                );













                draft saved

                draft discarded


















                StackExchange.ready(
                function ()
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f187207%2falphabet-completion-rate%23new-answer', 'question_page');

                );

                Post as a guest















                Required, but never shown

























                35 Answers
                35






                active

                oldest

                votes








                35 Answers
                35






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                1 2
                next










                14












                $begingroup$


                Python 3, 42 bytes





                lambda s:len(*s.upper()-*s.lower())/26


                Try it online!



                We filter all the non-alphabetic characters out of the string by taking the (set) difference of the uppercase and lowercase representations. Then, we take the length and divide by 26.




                Python 3, 46 bytes



                lambda s:sum(map(str.isalpha,*s.lower()))/26


                Try it online!



                Count the unique alphabetic (lowercase) characters, and divide by 26. In Python 2 it would require 3 more characters; two for changing *... to set(...), and one for making 26 a float: 26., to avoid floor division.




                Python 3, 46 bytes



                lambda s:sum('`'<c<''for c in*s.lower())/26


                Try it online!



                Same length, essentially the same as the previous one, but without "built-in" string method.






                share╙+C


                Run and debug it







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jun 21 at 14:05









                recursiverecursive

                6,85914 silver badges27 bronze badges




                6,85914 silver badges27 bronze badges





















                    1












                    $begingroup$


                    Python 2, 57 bytes





                    lambda i:len(set(o for o in i.lower()if o.isalpha()))/26.


                    Try it online!



                    A bit longer than the Python 3 answer from ArBo but posted as a different approach in Python 2 anyway.






                    share|improve this answer











                    $endgroup$

















                      1












                      $begingroup$


                      Python 2, 57 bytes





                      lambda i:len(set(o for o in i.lower()if o.isalpha()))/26.


                      Try it online!



                      A bit longer than the Python 3 answer from ArBo but posted as a different approach in Python 2 anyway.






                      share|improve this answer











                      $endgroup$















                        1












                        1








                        1





                        $begingroup$


                        Python 2, 57 bytes





                        lambda i:len(set(o for o in i.lower()if o.isalpha()))/26.


                        Try it online!



                        A bit longer than the Python 3 answer from ArBo but posted as a different approach in Python 2 anyway.






                        share|improve this answer











                        $endgroup$




                        Python 2, 57 bytes





                        lambda i:len(set(o for o in i.lower()if o.isalpha()))/26.


                        Try it online!



                        A bit longer than the Python 3 answer from ArBo but posted as a different approach in Python 2 anyway.







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Jun 21 at 14:29

























                        answered Jun 21 at 13:42









                        ElPedroElPedro

                        3,99812 silver badges28 bronze badges




                        3,99812 silver badges28 bronze badges





















                            1












                            $begingroup$


                            Jelly, 8 bytes



                            ŒuØAe€Æm


                            Try it online!



                            Explanation



                            Œu | Convert to upper case
                            ØAe€ | Check whether each capital letter is present, returning a list of 26 0s and 1s
                            Æm | Mean





                            share|improve this answer











                            $endgroup$

















                              1












                              $begingroup$


                              Jelly, 8 bytes



                              ŒuØAe€Æm


                              Try it online!



                              Explanation



                              Œu | Convert to upper case
                              ØAe€ | Check whether each capital letter is present, returning a list of 26 0s and 1s
                              Æm | Mean





                              share|improve this answer











                              $endgroup$















                                1












                                1








                                1





                                $begingroup$


                                Jelly, 8 bytes



                                ŒuØAe€Æm


                                Try it online!



                                Explanation



                                Œu | Convert to upper case
                                ØAe€ | Check whether each capital letter is present, returning a list of 26 0s and 1s
                                Æm | Mean





                                share|improve this answer











                                $endgroup$




                                Jelly, 8 bytes



                                ŒuØAe€Æm


                                Try it online!



                                Explanation



                                Œu | Convert to upper case
                                ØAe€ | Check whether each capital letter is present, returning a list of 26 0s and 1s
                                Æm | Mean






                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Jun 22 at 16:42

























                                answered Jun 21 at 11:55









                                Nick KennedyNick Kennedy

                                3,8847 silver badges12 bronze badges




                                3,8847 silver badges12 bronze badges





















                                    1












                                    $begingroup$

                                    C, 95 bytes



                                    f(char*s)32]=1;for(z=97;z<'z';*a+=a[z++]);return(*a*100)/26;


                                    (note: rounds down)



                                    Alternate decimal-returning version (95 bytes):



                                    float f(char*s)int a[256]=,z;while(*s&&a[*s++


                                    This borrows some from @Steadybox' answer.






                                    share|improve this answer








                                    New contributor



                                    Anonymous is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.





                                    $endgroup$








                                    • 1




                                      $begingroup$
                                      Welcome! Good first answer. It might be helpful for people reading your answer if you provide a short explanation of your code or an ungolfed version. It may also be helpful to provide a link to an online interpreter with your runnable code (see some other answers for examples). Many use TIO, and here's the gcc interpreter
                                      $endgroup$
                                      – mbomb007
                                      Jun 23 at 0:13















                                    1












                                    $begingroup$

                                    C, 95 bytes



                                    f(char*s)32]=1;for(z=97;z<'z';*a+=a[z++]);return(*a*100)/26;


                                    (note: rounds down)



                                    Alternate decimal-returning version (95 bytes):



                                    float f(char*s)int a[256]=,z;while(*s&&a[*s++


                                    This borrows some from @Steadybox' answer.






                                    share|improve this answer








                                    New contributor



                                    Anonymous is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.





                                    $endgroup$








                                    • 1




                                      $begingroup$
                                      Welcome! Good first answer. It might be helpful for people reading your answer if you provide a short explanation of your code or an ungolfed version. It may also be helpful to provide a link to an online interpreter with your runnable code (see some other answers for examples). Many use TIO, and here's the gcc interpreter
                                      $endgroup$
                                      – mbomb007
                                      Jun 23 at 0:13













                                    1












                                    1








                                    1





                                    $begingroup$

                                    C, 95 bytes



                                    f(char*s)32]=1;for(z=97;z<'z';*a+=a[z++]);return(*a*100)/26;


                                    (note: rounds down)



                                    Alternate decimal-returning version (95 bytes):



                                    float f(char*s)int a[256]=,z;while(*s&&a[*s++


                                    This borrows some from @Steadybox' answer.






                                    share|improve this answer








                                    New contributor



                                    Anonymous is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.





                                    $endgroup$



                                    C, 95 bytes



                                    f(char*s)32]=1;for(z=97;z<'z';*a+=a[z++]);return(*a*100)/26;


                                    (note: rounds down)



                                    Alternate decimal-returning version (95 bytes):



                                    float f(char*s)int a[256]=,z;while(*s&&a[*s++


                                    This borrows some from @Steadybox' answer.







                                    share|improve this answer








                                    New contributor



                                    Anonymous is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.








                                    share|improve this answer



                                    share|improve this answer






                                    New contributor



                                    Anonymous is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.








                                    answered Jun 22 at 23:27









                                    AnonymousAnonymous

                                    111 bronze badge




                                    111 bronze badge




                                    New contributor



                                    Anonymous is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.




                                    New contributor




                                    Anonymous is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.









                                    • 1




                                      $begingroup$
                                      Welcome! Good first answer. It might be helpful for people reading your answer if you provide a short explanation of your code or an ungolfed version. It may also be helpful to provide a link to an online interpreter with your runnable code (see some other answers for examples). Many use TIO, and here's the gcc interpreter
                                      $endgroup$
                                      – mbomb007
                                      Jun 23 at 0:13












                                    • 1




                                      $begingroup$
                                      Welcome! Good first answer. It might be helpful for people reading your answer if you provide a short explanation of your code or an ungolfed version. It may also be helpful to provide a link to an online interpreter with your runnable code (see some other answers for examples). Many use TIO, and here's the gcc interpreter
                                      $endgroup$
                                      – mbomb007
                                      Jun 23 at 0:13







                                    1




                                    1




                                    $begingroup$
                                    Welcome! Good first answer. It might be helpful for people reading your answer if you provide a short explanation of your code or an ungolfed version. It may also be helpful to provide a link to an online interpreter with your runnable code (see some other answers for examples). Many use TIO, and here's the gcc interpreter
                                    $endgroup$
                                    – mbomb007
                                    Jun 23 at 0:13




                                    $begingroup$
                                    Welcome! Good first answer. It might be helpful for people reading your answer if you provide a short explanation of your code or an ungolfed version. It may also be helpful to provide a link to an online interpreter with your runnable code (see some other answers for examples). Many use TIO, and here's the gcc interpreter
                                    $endgroup$
                                    – mbomb007
                                    Jun 23 at 0:13











                                    1












                                    $begingroup$


                                    K4, 14 13 bytes



                                    Solution:



                                    avg .Q.a in _


                                    Explanation:



                                    Rather stolen from inspired by Luis Mendo's Octave solution...



                                    avg .Q.a in _ / the solution
                                    _ / lowercase the input
                                    in / 'in' function
                                    .Q.a / "abcdefghijklmnopqrstuvwxyz"
                                    avg / average (mean)





                                    share|improve this answer











                                    $endgroup$

















                                      1












                                      $begingroup$


                                      K4, 14 13 bytes



                                      Solution:



                                      avg .Q.a in _


                                      Explanation:



                                      Rather stolen from inspired by Luis Mendo's Octave solution...



                                      avg .Q.a in _ / the solution
                                      _ / lowercase the input
                                      in / 'in' function
                                      .Q.a / "abcdefghijklmnopqrstuvwxyz"
                                      avg / average (mean)





                                      share|improve this answer











                                      $endgroup$















                                        1












                                        1








                                        1





                                        $begingroup$


                                        K4, 14 13 bytes



                                        Solution:



                                        avg .Q.a in _


                                        Explanation:



                                        Rather stolen from inspired by Luis Mendo's Octave solution...



                                        avg .Q.a in _ / the solution
                                        _ / lowercase the input
                                        in / 'in' function
                                        .Q.a / "abcdefghijklmnopqrstuvwxyz"
                                        avg / average (mean)





                                        share|improve this answer











                                        $endgroup$




                                        K4, 14 13 bytes



                                        Solution:



                                        avg .Q.a in _


                                        Explanation:



                                        Rather stolen from inspired by Luis Mendo's Octave solution...



                                        avg .Q.a in _ / the solution
                                        _ / lowercase the input
                                        in / 'in' function
                                        .Q.a / "abcdefghijklmnopqrstuvwxyz"
                                        avg / average (mean)






                                        share|improve this answer














                                        share|improve this answer



                                        share|improve this answer








                                        edited Jun 23 at 8:55

























                                        answered Jun 23 at 8:46









                                        streetsterstreetster

                                        2,8896 silver badges15 bronze badges




                                        2,8896 silver badges15 bronze badges





















                                            1












                                            $begingroup$


                                            Python 3, 51 49 bytes



                                            -2 bytes, thanks to alexz02





                                            lambda s:len(*filter(str.isalpha,s.lower()))/26


                                            Try it online!






                                            share|improve this answer











                                            $endgroup$












                                            • $begingroup$
                                              49 bytes lambda s:len(*filter(str.isalpha,s.lower()))/26
                                              $endgroup$
                                              – alexz02
                                              Jun 24 at 8:34










                                            • $begingroup$
                                              @alexz02 Thank you! :)
                                              $endgroup$
                                              – ruohola
                                              Jun 24 at 8:42















                                            1












                                            $begingroup$


                                            Python 3, 51 49 bytes



                                            -2 bytes, thanks to alexz02





                                            lambda s:len(*filter(str.isalpha,s.lower()))/26


                                            Try it online!






                                            share|improve this answer











                                            $endgroup$












                                            • $begingroup$
                                              49 bytes lambda s:len(*filter(str.isalpha,s.lower()))/26
                                              $endgroup$
                                              – alexz02
                                              Jun 24 at 8:34










                                            • $begingroup$
                                              @alexz02 Thank you! :)
                                              $endgroup$
                                              – ruohola
                                              Jun 24 at 8:42













                                            1












                                            1








                                            1





                                            $begingroup$


                                            Python 3, 51 49 bytes



                                            -2 bytes, thanks to alexz02





                                            lambda s:len(*filter(str.isalpha,s.lower()))/26


                                            Try it online!






                                            share|improve this answer











                                            $endgroup$




                                            Python 3, 51 49 bytes



                                            -2 bytes, thanks to alexz02





                                            lambda s:len(*filter(str.isalpha,s.lower()))/26


                                            Try it online!







                                            share|improve this answer














                                            share|improve this answer



                                            share|improve this answer








                                            edited Jun 24 at 8:42

























                                            answered Jun 23 at 17:26









                                            ruoholaruohola

                                            1415 bronze badges




                                            1415 bronze badges











                                            • $begingroup$
                                              49 bytes lambda s:len(*filter(str.isalpha,s.lower()))/26
                                              $endgroup$
                                              – alexz02
                                              Jun 24 at 8:34










                                            • $begingroup$
                                              @alexz02 Thank you! :)
                                              $endgroup$
                                              – ruohola
                                              Jun 24 at 8:42
















                                            • $begingroup$
                                              49 bytes lambda s:len(*filter(str.isalpha,s.lower()))/26
                                              $endgroup$
                                              – alexz02
                                              Jun 24 at 8:34










                                            • $begingroup$
                                              @alexz02 Thank you! :)
                                              $endgroup$
                                              – ruohola
                                              Jun 24 at 8:42















                                            $begingroup$
                                            49 bytes lambda s:len(*filter(str.isalpha,s.lower()))/26
                                            $endgroup$
                                            – alexz02
                                            Jun 24 at 8:34




                                            $begingroup$
                                            49 bytes lambda s:len(*filter(str.isalpha,s.lower()))/26
                                            $endgroup$
                                            – alexz02
                                            Jun 24 at 8:34












                                            $begingroup$
                                            @alexz02 Thank you! :)
                                            $endgroup$
                                            – ruohola
                                            Jun 24 at 8:42




                                            $begingroup$
                                            @alexz02 Thank you! :)
                                            $endgroup$
                                            – ruohola
                                            Jun 24 at 8:42











                                            1












                                            $begingroup$


                                            JavaScript (Node.js), 45 bytes





                                            s=>~-s.match(/$|([a-z])(?!.*1)/ig).length/26


                                            Try it online!





                                            JavaScript (Node.js), 47 bytes





                                            s=>(s.match(/([a-z])(?!.*1)/ig)||[]).length/26


                                            Try it online!






                                            share|improve this answer











                                            $endgroup$

















                                              1












                                              $begingroup$


                                              JavaScript (Node.js), 45 bytes





                                              s=>~-s.match(/$|([a-z])(?!.*1)/ig).length/26


                                              Try it online!





                                              JavaScript (Node.js), 47 bytes





                                              s=>(s.match(/([a-z])(?!.*1)/ig)||[]).length/26


                                              Try it online!






                                              share|improve this answer











                                              $endgroup$















                                                1












                                                1








                                                1





                                                $begingroup$


                                                JavaScript (Node.js), 45 bytes





                                                s=>~-s.match(/$|([a-z])(?!.*1)/ig).length/26


                                                Try it online!





                                                JavaScript (Node.js), 47 bytes





                                                s=>(s.match(/([a-z])(?!.*1)/ig)||[]).length/26


                                                Try it online!






                                                share|improve this answer











                                                $endgroup$




                                                JavaScript (Node.js), 45 bytes





                                                s=>~-s.match(/$|([a-z])(?!.*1)/ig).length/26


                                                Try it online!





                                                JavaScript (Node.js), 47 bytes





                                                s=>(s.match(/([a-z])(?!.*1)/ig)||[]).length/26


                                                Try it online!







                                                share|improve this answer














                                                share|improve this answer



                                                share|improve this answer








                                                edited Jun 25 at 2:35

























                                                answered Jun 24 at 4:42









                                                tshtsh

                                                10.2k1 gold badge16 silver badges57 bronze badges




                                                10.2k1 gold badge16 silver badges57 bronze badges





















                                                    0












                                                    $begingroup$


                                                    V, 30, 29 bytes



                                                    ÓÁ
                                                    òó㈁“±òAÝ/26.0|Óá
                                                    C="


                                                    Try it online!






                                                    share|improve this answer











                                                    $endgroup$

















                                                      0












                                                      $begingroup$


                                                      V, 30, 29 bytes



                                                      ÓÁ
                                                      òó㈁“±òAÝ/26.0|Óá
                                                      C="


                                                      Try it online!






                                                      share|improve this answer











                                                      $endgroup$















                                                        0












                                                        0








                                                        0





                                                        $begingroup$


                                                        V, 30, 29 bytes



                                                        ÓÁ
                                                        òó㈁“±òAÝ/26.0|Óá
                                                        C="


                                                        Try it online!






                                                        share|improve this answer











                                                        $endgroup$




                                                        V, 30, 29 bytes



                                                        ÓÁ
                                                        òó㈁“±òAÝ/26.0|Óá
                                                        C="


                                                        Try it online!







                                                        share|improve this answer














                                                        share|improve this answer



                                                        share|improve this answer








                                                        edited Jun 21 at 20:34

























                                                        answered Jun 21 at 20:28









                                                        DJMcMayhemDJMcMayhem

                                                        41.2k12 gold badges153 silver badges321 bronze badges




                                                        41.2k12 gold badges153 silver badges321 bronze badges




















                                                            1 2
                                                            next
















                                                            draft saved

                                                            draft discarded
















































                                                            If this is an answer to a challenge…



                                                            • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                                                            • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                                                              Explanations of your answer make it more interesting to read and are very much encouraged.


                                                            • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.


                                                            More generally…



                                                            • …Please make sure to answer the question and provide sufficient detail.


                                                            • …Avoid asking for help, clarification or responding to other answers (use comments instead).




                                                            draft saved


                                                            draft discarded














                                                            StackExchange.ready(
                                                            function ()
                                                            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f187207%2falphabet-completion-rate%23new-answer', 'question_page');

                                                            );

                                                            Post as a guest















                                                            Required, but never shown





















































                                                            Required, but never shown














                                                            Required, but never shown












                                                            Required, but never shown







                                                            Required, but never shown

































                                                            Required, but never shown














                                                            Required, but never shown












                                                            Required, but never shown







                                                            Required, but never shown







                                                            Popular posts from this blog

                                                            Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                                                            Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                                                            Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림