jayur commited on
Commit
9d17fe3
·
verified ·
1 Parent(s): f4620ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -23,7 +23,8 @@ def lingua_stats(language:str)->str: #it's import to specify the return type
23
  agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
24
  world_population = agent.run("What is the world population?")
25
  lang_spkrs = agent.run(f"How many people in the speak {language}?")
26
- return f"The percentage of {language} speaking population in the world is : {lang_spkrs}/{world_population}"
 
27
  except Exception as e:
28
  return f"Error: Search failed for {language}"
29
 
 
23
  agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
24
  world_population = agent.run("What is the world population?")
25
  lang_spkrs = agent.run(f"How many people in the speak {language}?")
26
+ lang_spkrs_pct = (lang_spkrs/world_population)*100
27
+ return f"The percentage of {language} speaking population in the world is : ({str(lang_spkrs_pct)})"
28
  except Exception as e:
29
  return f"Error: Search failed for {language}"
30