xxxxxxxxxx
let eval_var variable liste =
let rec aux = function
| [] -> false
| h::t -> variable = h || aux t
in
aux liste;;
xxxxxxxxxx
from __future__ import division
import os
import sys
import glob
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
%matplotlib inline
%precision 4
plt.style.use('ggplot')
xxxxxxxxxx
#include <stdio.h>
int main()
{
int n,np=0,i,j,flag=0;
scanf("%d",&n);
for(i=2;i<=n;i++)
{
for(j=1,flag=0;j<=i;j++)
{
if(i%j==0)
flag++;
}
if(flag==2)
np++;
}
int total=n-2+1;
for(i=total/2;i>=1;i--)
if(total%i==0&&np%i==0)
{
total/=i;
np/=i;
}
printf("%d/%d",np,total);
return 0;
}
xxxxxxxxxx
#include <stdio.h>
int main()
{
char name [20] = "Lakshmisprasad";
char email [40]="lakshmiprasad018@gmail.com";
char slack[10]="@lakshmip";
char twitter[20]="Lakshmip2798";
char biostack [20]="Functional Genomics";
printf("name:%s\nemail:%s\ntwitter:%s\nbiostack:%s\nslack:%s\n",name,email,twitter,biostack, slack );
return 0;
}
xxxxxxxxxx
float(input("Digite quantos litros você quer abastecer: "))
input("Digite A para álcool ou G para gasolina: ")
if combustivel == "A" or combustivel == "a":
preco = litros * 1.9
if litros <= 20:
preco -= 1.9 * litros * 3 / 100
else:
preco -= 1.9 * litros * 5 / 100
elif combustivel == "G" or combustivel == "g":
preco = litros * 2.5
if litros <= 20:
preco -= 2.5 * litros * 4 / 100
else:
preco -= 2.5 * litros * 6 / 100
print(f"O preço a pagar é R${preco:.2f}")
xxxxxxxxxx
#include <stdio.h>
#include <string.h>
int mylen(char *n);
int mylen(char *n)
{
int count=0;
for(int i=0; n[i]!='\0'; i++){
count++;
}
printf("count=%d",count);
return count;
}
int main(void){
char name[20];
printf("enter name:\n");
scanf("%s",&name);
puts(name);
int len = mylen(name);
printf("length = %d",len);
return 0;
}
xxxxxxxxxx
s=input()
x= int(input())
unt = 0
n = 0
1=len(s)
f= False
for i in range(1) : n=n*10+int (s[i])
if n<=x:
print (n)
f=True
else:
if f:
count += 1 n=int(s[i]) f= False
if n<=x:
f = 7 True
else:
n = 0
if f= True: count +=1
print(count)
xxxxxxxxxx
void motor_set_position_sync(WbDeviceTag tag_motor, WbDeviceTag tag_sensor, double target, int delay) {
const double DELTA = 0.001; // max tolerated difference
wb_motor_set_position(tag_motor, target);
wb_position_sensor_enable(tag_sensor, TIME_STEP);
double effective; // effective position
do {
if (wb_robot_step(TIME_STEP) == -1)
break;
delay -= TIME_STEP;
effective = wb_position_sensor_get_value(tag_sensor);
} while (fabs(target - effective) > DELTA && delay > 0);
wb_position_sensor_disable(tag_sensor);
}
xxxxxxxxxx
#Importting csv module
import csv
#csv file name
filename= "aapi.csv"
# intiliaze titles and rows
fields =0
rows = 0
# reading csv file
with open(filename,'r') as csvfile:
# extract each data row one by one
csvreader=csv.reader(csvfile)
rows.append(rows)
# get total no of rwos
print("Total no of rows:%d%(csvreader.line_num)")
# print fields name
print('Field names are:' + ', '.join(field for field in fields))
# print first 5 rows
print('\n First 5 rows are:\n')
for row in rows[:5]:
# parsing each column of rows
for col in row:
print("%10s"%col),
print('\n')